/**
 * Extended Manager Mode Styles
 * Erweiterte Styles für Manager-Funktionen
 */

/* ===================================
   Manager Mode Switch (Angepasst)
   =================================== */

.mode-switch-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.mode-switch-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
}

.mode-switch-label.management-label {
    color: #27ae60; /* GRÜN statt Blau */
}

.mode-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

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

.mode-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc !important; /* GRAU wenn inaktiv - deutlicher! */
    transition: .3s;
    border-radius: 24px;
}

.mode-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.mode-switch input:checked + .mode-switch-slider {
    background-color: #27ae60 !important; /* GRÜN wenn aktiv - mit !important */
}

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

.mode-switch input:checked ~ .mode-switch-label {
    color: #27ae60 !important; /* GRÜN wenn aktiv */
}

/* ===================================
   Dropdown Navigation
   =================================== */

.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-icon {
    transition: transform 0.2s;
}

.nav-dropdown.active .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
    margin-top: 0.5rem;
    overflow: hidden;
}

.nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #1f2937;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: #27ae60;
}

.dropdown-item svg {
    flex-shrink: 0;
    color: #6b7280;
    transition: color 0.15s;
}

.dropdown-item:hover svg {
    color: #27ae60;
}

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

/* ===================================
   Manager Dashboard Stats
   =================================== */

.manager-shift-item {
    border-left: 3px solid #27ae60;
}

.shift-registrations {
    margin-top: 0.75rem;
}

.registrations-count {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.registrations-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.registrations-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60 0%, #229954 100%);
    border-radius: 3px;
    transition: width 0.3s;
}

.shift-status-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.shift-status-badges .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
}

/* ===================================
   Bereichs- und Schichtverwaltung
   =================================== */

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

.management-actions {
    display: flex;
    gap: 0.75rem;
}

.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.management-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.management-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.management-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.management-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.management-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.meta-row svg {
    flex-shrink: 0;
    color: #9ca3af;
}

.management-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.btn-icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* ===================================
   Modal für Bereiche/Schichten
   =================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
    border-radius: 6px;
}

.modal-close:hover {
    color: #1f2937;
    background: #f3f4f6;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ===================================
   Form Styles
   =================================== */

.form-grid {
    display: grid;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ===================================
   Regeln-Editor
   =================================== */

.rules-section {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

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

.rules-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.rule-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rule-content {
    flex: 1;
}

.rule-type {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.rule-description {
    font-size: 0.875rem;
    color: #1f2937;
}

.rule-actions {
    display: flex;
    gap: 0.5rem;
}

/* ===================================
   Sichtbarkeits-Einstellungen
   =================================== */

.visibility-settings {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.visibility-options {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.visibility-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.visibility-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.visibility-option label {
    font-size: 0.875rem;
    color: #1f2937;
    cursor: pointer;
}

.visibility-datetime {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

/* ===================================
   Farbverlauf-Picker (Erweitert)
   =================================== */

.gradient-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.gradient-option {
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.gradient-option:hover {
    transform: scale(1.05);
}

.gradient-option.selected {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.gradient-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.custom-gradient-input {
    grid-column: span 4;
}

/* ===================================
   Schnellzugriff-Grid (Manager)
   =================================== */

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.quick-access-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.quick-access-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #27ae60;
}

.quick-access-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    border-radius: 12px;
    color: white;
}

.quick-access-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* ===================================
   Template-Badge
   =================================== */

.template-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===================================
   Duplizieren-Button
   =================================== */

.btn-duplicate {
    background: #f3f4f6;
    color: #4b5563;
}

.btn-duplicate:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* ===================================
   Responsive Anpassungen
   =================================== */

@media (max-width: 768px) {
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .gradient-picker {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-access-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}