/* Chor Portal - Main Stylesheet
   Salbeigrün & Blau Farbschema */

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Hauptfarben - Salbeigrün & Blau */
    --color-sage: #687864;
    --color-dark-blue: #31708E;
    --color-medium-blue: #5085A5;
    --color-light-blue: #8FC1E3;
    --color-lightest: #F7F9FB;

    /* Semantische Farben */
    --primary-color: #31708E;
    --primary-hover: #5085A5;
    --primary-light: #8FC1E3;
    --secondary-color: #687864;
    --accent-color: #5085A5;

    /* Text */
    --text-dark: #0f172a;
    --text-default: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;

    /* Hintergründe */
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --bg-subtle: #F7F9FB;

    /* Status */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    /* Rahmen & Schatten */
    --border-color: #e5e7eb;
    --border-accent: #8FC1E3;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px rgba(49, 112, 142, 0.1);
    --shadow-lg: 0 8px 24px rgba(49, 112, 142, 0.15);

    /* Radii */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Fonts */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #31708E 0%, #5085A5 100%);
    --gradient-secondary: linear-gradient(135deg, #687864 0%, #31708E 100%);
    --gradient-accent: linear-gradient(135deg, #5085A5 0%, #8FC1E3 100%);
    --gradient-hero: linear-gradient(135deg, #687864 0%, #31708E 50%, #5085A5 100%);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-light);
    color: var(--text-default);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.main-header {
    background: var(--gradient-secondary);
    box-shadow: 0 4px 12px rgba(49, 112, 142, 0.15);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.profile-image:hover {
    border-color: rgba(255,255,255,0.6);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.user-role {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.85);
}

/* Navigation */
.main-nav {
    display: none;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.3s;
    background: transparent;
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
}

.nav-link.active {
    background: rgba(255,255,255,0.25);
    font-weight: 600;
}

.nav-link.signal-link {
    background: rgba(143, 193, 227, 0.25);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.nav-link.signal-link:hover {
    background: rgba(143, 193, 227, 0.35);
}

.nav-link.logout-link {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
}

.nav-link.logout-link:hover {
    background: rgba(255,255,255,0.25);
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.3);
    margin: 0 0.5rem;
}

/* Profil-Dropdown */
.profile-menu {
    position: relative;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 240px;
    z-index: 1001;
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

.profile-dropdown.active {
    display: block;
}

.profile-dropdown-header {
    padding: 1.25rem;
    background: var(--gradient-accent);
    color: white;
}

.profile-dropdown-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.profile-dropdown-header p {
    margin: 0;
    font-size: 0.8125rem;
    opacity: 0.9;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-default);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9375rem;
    font-weight: 500;
}

.profile-dropdown-item:hover {
    background: var(--bg-light);
}

.profile-dropdown-item .icon {
    font-size: 1.125rem;
    width: 1.5rem;
    text-align: center;
}

.profile-dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.5rem 0;
}

.profile-dropdown-item.logout {
    color: var(--danger-color);
    font-weight: 600;
}

.profile-dropdown-item.logout:hover {
    background: #fef2f2;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    z-index: 1000;
    width: 44px;
    height: 44px;
    padding: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    transition: transform 0.3s, opacity 0.3s;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    background: linear-gradient(135deg, #687864 0%, #31708E 100%);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 999;
    width: auto;
    white-space: nowrap;
}

.mobile-nav.active { display: flex; }
.mobile-nav .nav-link { padding: 0.625rem 1.25rem; border-radius: var(--radius-sm); }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    padding: 1rem 0;
    min-height: calc(100vh - 200px);
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    text-align: center;
    padding: 0.875rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-xl);
    background: var(--gradient-hero);
    color: white;
    box-shadow: 0 4px 20px rgba(49, 112, 142, 0.2);
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: white;
}

.hero-subtitle {
    font-size: 0.9375rem;
    color: white;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   CARD COMPONENTS
   ============================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    border: 2px solid var(--border-accent);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-hover);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   SECTION COMPONENTS
   ============================================ */
.section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 6px rgba(49, 112, 142, 0.2);
}

.btn-primary:hover {
    background: var(--gradient-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 112, 142, 0.3);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--primary-color);
    border: 2px solid var(--border-accent);
}

.btn-secondary:hover {
    background: var(--gradient-accent);
    color: white;
    border-color: var(--primary-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-default);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 3px rgba(80, 133, 165, 0.15);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   TABLE STYLES
   ============================================ */
.table-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-subtle);
    font-weight: 600;
    color: var(--primary-color);
}

.table tr:hover {
    background: var(--bg-subtle);
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem 1rem;
    border-bottom: 2px solid var(--border-accent);
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 2;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-body {
    padding: 1.5rem 2rem;
}

.modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    background: var(--bg-white);
    z-index: 2;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Form innerhalb Modal */
.modal-content > form {
    display: contents;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

/* ============================================
   BADGE STYLES
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: var(--gradient-secondary); color: white; }
.badge-warning { background: var(--gradient-primary); color: white; }
.badge-success { background: var(--gradient-accent); color: white; }
.badge-danger { background: var(--danger-color); color: white; }

/* ============================================
   ALERT STYLES
   ============================================ */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.alert-error {
    background: #fee2e2;
    color: var(--danger-color);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: var(--success-color);
    border: 1px solid #a7f3d0;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-light { color: var(--text-light); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ============================================
   TOGGLE SWITCH
   ============================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #cbd5e1;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--gradient-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {

    .cards-grid { grid-template-columns: 1fr; }

    .user-name { font-size: 1rem; }
    .hero-title { font-size: 2rem; }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

}

@media (min-width: 769px) {
    .mobile-nav { display: none; }
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
}

.login-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.75rem;
    font-weight: 700;
}
