/* ==========================================
   LAND VON ARAN - EVENT KALENDER STYLES
   Modernisiertes Fantasy-Design
   ========================================== */

/* Google Fonts einbinden */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lora:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --aran-dark: #2c241b;      /* Tieferes, wärmeres Dunkelbraun/Schwarz */
    --aran-red: #8b2626;       /* Kräftigeres Aran-Rot */
    --aran-gold: #d4af37;      /* Edles Gold für Akzente */
    --parchment: #f4ebd8;      /* Helleres, sauberes Pergament */
    --parchment-dark: #e3d3b4; /* Schatten des Pergaments */
    --bg-dark: #110e0d;        /* Fast schwarzer Hintergrund drumherum */
    --text-light: #f9f6f0;
    --transition: all 0.3s ease; /* Weiche Übergänge für Hover-Effekte */
}

/* Basis-Einstellungen */
/* Basis-Einstellungen */
body {
    font-family: 'Lora', serif;
    background-color: var(--bg-dark); 
    
    /* NEU: Die Verdunkelung wird direkt in das Bild "hineingemischt" */
    background-image: linear-gradient(rgba(17, 14, 13, 0), rgba(17, 14, 13, 0)), url('hintergrund.jpg');
    
    background-size: cover; 
    background-position: center center; 
    background-attachment: fixed; 
    min-height: 100vh; /* Sorgt dafür, dass der Body immer mindestens den ganzen Bildschirm füllt */
    
    color: var(--aran-dark);
    margin: 0;
    padding: 40px 20px;
    line-height: 1.6;
}

h1, h2, h3, h4, .cinzel-text {
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

/* Header */
.aran-header {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

.aran-header h1 {
    font-size: 3.5rem;
    margin-bottom: 5px;
    color: var(--aran-gold);
    text-shadow: 2px 2px 8px rgba(0,0,0,0.6);
    letter-spacing: 2px;
}

.aran-header p {
    font-size: 1.2rem;
    font-style: italic;
    opacity: 0.8;
}

/* Der Hauptcontainer (Das Pergament) */
.aran-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8), inset 0 0 60px rgba(0,0,0,0.03);
    /* Ein sanfter Verlauf lässt das Pergament edler wirken */
    background: linear-gradient(135deg, var(--parchment) 0%, #e8dec7 100%);
    border: 1px solid #c2b290;
    position: relative;
}

/* Navigation / Tabs */
.event-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
    border-bottom: 2px solid rgba(44, 36, 27, 0.2);
    padding-bottom: 15px;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    font-size: 1.1rem;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    color: var(--aran-dark);
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 6px;
    transition: var(--transition);
}

.tab-btn:hover {
    background-color: rgba(44, 36, 27, 0.05);
    color: var(--aran-red);
}

.tab-btn.active {
    background-color: var(--aran-dark);
    color: var(--parchment);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border-color: var(--aran-dark);
}

.tab-btn.btn-primary {
    margin-left: auto;
    background-color: var(--aran-red);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(139, 38, 38, 0.3);
}

.tab-btn.btn-primary:hover {
    background-color: #a63232;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(139, 38, 38, 0.5);
}

.tab-btn.btn-warning {
    color: #d97706;
}
.tab-btn.btn-warning:hover {
    background-color: rgba(217, 119, 6, 0.1);
}
.tab-btn.btn-warning.active {
    background-color: #d97706;
    color: white;
}

/* Animation für die Ansichten */
.event-view {
    animation: fadeIn 0.4s ease;
}

/* Event-Karten (Listenansicht) */
.event-card {
    display: flex;
    background-color: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--parchment-dark);
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 8px;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.event-card:hover {
    transform: translateY(-3px);
    background-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: #c2b290;
}

.event-card.pending {
    border-color: #d97706;
    background-color: rgba(217, 119, 6, 0.05);
}
.event-card.pending:hover { background-color: rgba(217, 119, 6, 0.1); }

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, var(--aran-dark), #4a3d30);
    color: var(--parchment);
    min-width: 80px;
    padding: 15px;
    border-radius: 8px;
    margin-right: 25px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.event-card.pending .event-date {
    background: linear-gradient(to bottom, #d97706, #b45309);
}

.event-date .day {
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    line-height: 1;
}

.event-date .month {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.event-details {
    flex-grow: 1;
}

.event-details h3 {
    margin: 5px 0;
    font-size: 1.6rem;
    color: var(--aran-red);
}

.event-meta {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
}

.event-desc {
    line-height: 1.7;
    margin: 0;
}

/* Event-Kategorien Tags */
.event-type {
    display: inline-block;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Schwarze Schrift für helle Gelbtöne, damit man es lesen kann */
.type-gelb { background-color: #F2C80F; color: #2c241b; } 

/* Weiße Schrift für alle anderen */
.type-information { background-color: #E68A3A; }
.type-ernennung { background-color: #A67A3A; }
.type-eroeffnung { background-color: #3A8F8A; }
.type-expedition { background-color: #2F6A6A; }
.type-taverne { background-color: #7A3A3A; }
.type-fest { background-color: #D46A3A; }
.type-wettbewerb { background-color: #6A2F4F; }
.type-blau { background-color: #4E6083; } /* Für Justiz, Gericht, Hinrichtung */
.type-armee { background-color: #6A6A6A; }
.type-gruen { background-color: #228B22; } /* Für Klerus, Hochzeit, etc. */
.type-sonstiges { background-color: #9A9FA6; }


/* Admin Controls & Buttons in Listen */
.admin-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--parchment-dark);
    display: flex;
    gap: 10px;
}

.btn-action {
    font-family: inherit;
    font-weight: bold;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-approve { background: #3b5a26; color: white; }
.btn-approve:hover { background: #2d461d; transform: translateY(-2px); }
.btn-delete { background: #8b2626; color: white; }
.btn-delete:hover { background: #6a1c1c; transform: translateY(-2px); }

/* Kalender Grid Styling */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: rgba(255,255,255,0.4);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid var(--parchment-dark);
}

.calendar-controls a {
    text-decoration: none;
    background: var(--aran-dark);
    color: var(--parchment);
    padding: 8px 15px;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    transition: var(--transition);
}
.calendar-controls a:hover { 
    background: var(--aran-red); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px; /* Erzeugt den Rahmen zwischen den Tagen */
    background: rgba(44, 36, 27, 0.2);
    border: 1px solid var(--parchment-dark);
    border-radius: 8px;
    overflow: hidden; /* Hält die runden Ecken */
}

.calendar-header-day {
    text-align: center;
    font-weight: bold;
    background: var(--aran-dark);
    color: var(--parchment);
    padding: 12px 0;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.calendar-day {
    background: rgba(255, 255, 255, 0.4);
    min-height: 120px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    transition: background 0.2s;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.7);
}

.calendar-day.empty { 
    background: rgba(0, 0, 0, 0.03); 
}
.calendar-day.today { 
    background: #fdfaf3;
    box-shadow: inset 0 0 0 2px var(--aran-red); 
}

.day-number {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--aran-dark);
    margin-bottom: 8px;
    text-align: right;
    display: block;
    font-family: 'Cinzel', serif;
}

/* ==========================================
   FIX: LANGE TITEL IM KALENDER ABSCHNEIDEN
   ========================================== */
.cal-event-badge {       /* Verbietet dem Text, einen Zeilenumbruch zu machen */
    overflow: hidden;          /* Versteckt alles, was über den Rand hinausgeht */
    text-overflow: ellipsis;   /* Fügt automatisch "..." am Ende des abgeschnittenen Textes an */
    display: block;            /* Zwingt das Element, sich an die Kastenbreite zu halten */
    max-width: 100%;           /* Darf niemals breiter als der Tagestag werden */
    box-sizing: border-box;    /* Verhindert, dass Innenabstände das Kästchen vergrößern */
    
    /* Falls du diese Werte noch nicht hast, hier ein paar schöne Standards für die Badges: */
    padding: 4px 6px;
    margin-bottom: 4px;
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
}
.cal-event-badge:hover {
    transform: scale(1.02);
}

/* Formulare */
.form-group { margin-bottom: 20px; }
.form-group label { 
    display: block; 
    font-weight: bold; 
    margin-bottom: 8px; 
    color: var(--aran-dark);
    font-family: 'Cinzel', serif;
}
.form-group input, .form-group select, .form-group textarea { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--parchment-dark); 
    background: rgba(255,255,255,0.6); 
    font-family: inherit; 
    font-size: 1rem;
    box-sizing: border-box;
    border-radius: 6px;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--aran-dark);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44, 36, 27, 0.1);
}

.submit-btn {
    width: 100%; 
    font-size: 1.2rem; 
    padding: 15px; 
    cursor: pointer;
    background-color: var(--aran-red);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    letter-spacing: 1px;
    transition: var(--transition);
}
.submit-btn:hover {
    background-color: #a63232;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(139, 38, 38, 0.4);
}

/* System Messages */
.sys-message {
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    animation: fadeInDown 0.5s ease;
}
.sys-success { background: rgba(76, 175, 80, 0.1); border: 1px solid #4CAF50; color: #2e7d32; }
.sys-info { background: rgba(33, 150, 243, 0.1); border: 1px solid #2196F3; color: #1565c0; }

/* Keyframes für weiches Einblenden */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   NEU: BEARBEITEN BUTTON & TOOLTIPS
   ========================================== */

.btn-edit { background: #d97706; color: white; }
.btn-edit:hover { background: #b45309; transform: translateY(-2px); }

/* Custom Pergament Tooltip für den Kalender */
.tooltip-container {
    position: relative;
    cursor: pointer;
}

.aran-tooltip {
    display: none;
    position: absolute;
    bottom: 110%; /* Schwebt über dem Eintrag */
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    background: linear-gradient(135deg, var(--parchment) 0%, #e8dec7 100%);
    border: 2px solid var(--aran-dark);
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
    color: var(--aran-dark);
    z-index: 1000;
    white-space: normal; /* Erlaubt Zeilenumbrüche */
    font-family: 'Lora', serif;
    font-size: 0.9rem;
    text-align: left;
}

/* Ein kleiner Pfeil, der vom Tooltip nach unten zeigt */
.aran-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: var(--aran-dark) transparent transparent transparent;
}

.tooltip-container:hover .aran-tooltip {
    display: block;
    animation: fadeInDown 0.2s ease-out reverse; /* Sanftes Einblenden */
}

.tooltip-title {
    font-family: 'Cinzel', serif;
    font-weight: bold;
    color: var(--aran-red);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 5px;
    margin-bottom: 5px;
}

/* ==========================================
   NEU: EVENT MODAL (POPUP)
   ========================================== */
.aran-modal {
    display: none; /* Standardmäßig versteckt */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Dunkler Hintergrund */
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.aran-modal-content {
    background: linear-gradient(135deg, var(--parchment) 0%, #e8dec7 100%);
    border: 2px solid var(--aran-dark);
    border-radius: 8px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
    color: var(--aran-dark);
}

.aran-modal-close {
    color: var(--aran-dark);
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.aran-modal-close:hover {
    color: var(--aran-red);
}

/* ==========================================
   MOBILE ANSICHT (SMARTPHONES & TABLETS)
   ========================================== */
@media (max-width: 768px) {
    /* Container & Header anpassen */
    body { padding: 10px; }
    .aran-container { padding: 20px; }
    .aran-header h1 { font-size: 2.2rem; }
    
    /* Tabs (Navigation) */
    .event-tabs {
        justify-content: center;
        gap: 8px;
    }
    .tab-btn {
        width: 100%;
        text-align: center;
        padding: 12px;
        font-size: 1rem;
    }
    
    /* Event-Karten in der Liste */
    .event-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .event-date {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
        max-width: 150px;
    }
    
    /* Admin Buttons für Touch optimieren */
    .admin-controls {
        flex-direction: column;
        width: 100%;
    }
    .admin-controls form, .admin-controls button {
        width: 100%;
        margin-bottom: 5px;
    }
    
    /* Kalender-Grid für Wischgesten vorbereiten */
    .calendar-wrapper {
        overflow-x: auto;
        padding-bottom: 15px;
        margin-left: -20px; /* Erweitert den Wischbereich bis zum Rand */
        margin-right: -20px;
        padding-left: 20px;
        padding-right: 20px;
    }
    .calendar-grid {
        min-width: 700px; /* Zwingt das Grid, breit genug für die Kästchen zu bleiben */
    }
    
    /* Popup / Modal */
    .aran-modal-content {
        padding: 20px;
        width: 95%;
    }
	/* Kalender-Navigation für Handys anpassen */
    .calendar-controls {
        flex-wrap: wrap;       /* Erlaubt den Elementen, in eine neue Zeile zu springen */
        justify-content: center;
        gap: 12px;             /* Etwas Luft dazwischen */
        padding: 15px 10px;
    }
    
    .calendar-controls h2 {
        width: 100%;           /* Der Monat nimmt die volle Breite ein... */
        order: -1;             /* ...und wird dadurch zwingend als Erstes (oben) angezeigt! */
        text-align: center;
        margin-bottom: 10px !important;
    }
    
    .calendar-controls a {
        flex: 1;               /* Beide Buttons teilen sich den restlichen Platz genau 50/50 */
        text-align: center;
        font-size: 0.85rem;    /* Schrift minimal kleiner, damit das "Vorheriger Monat" gut reinpasst */
        padding: 10px 5px;     
        white-space: nowrap;   /* Verhindert komische Wortumbrüche im Button */
    }
}

.event-meta strong {
    color: var(--aran-red); /* Macht die Labels wie "Ort:" oder "Herold:" rot */
}

/* ==========================================
   NEU: KLICKBARE LINKS
   ========================================== */
.aran-link {
    color: var(--aran-red);
    text-decoration: underline;
    font-weight: bold;
    transition: var(--transition);
}

.aran-link:hover {
    color: #d97706; /* Ein schönes Orange/Gold beim Drüberfahren */
    text-decoration: none;
}