@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Roboto+Slab:wght@700&family=Trocchi&display=swap');

:root {
    --color-brand-primary: #b4cc24;
    --color-brand-primary-hover: #a2b91f;
    --color-brand-primary-soft: #eff5d2;
    --color-brand-secondary: #b51f7d;
    --color-brand-secondary-hover: #9e1a6d;
    --color-brand-secondary-soft: #f5ddec;
    --color-brand-accent: #f15a3c;
    --color-brand-accent-soft: #fde4de;
    --color-white: #fff;
    --color-black: #151515;
    --color-text-primary: #1b1b18;
    --color-text-secondary: #56564f;
    --color-text-muted: #77776f;
    --color-surface: #fff;
    --color-surface-subtle: #f6f6f1;
    --color-surface-warm: #faf9f4;
    --color-border: #deded5;
    --color-border-strong: #babAAF;
    --color-success: #2e7d32;
    --color-warning: #a15c00;
    --color-error: #b3261e;
    --color-info: #245ea8;
    --color-focus: #b51f7d;
    --color-success-soft: #e7f3e7;
    --color-warning-soft: #fff0d6;
    --color-error-soft: #fbe9e7;
    --color-overlay: rgb(21 21 21 / 55%);
    --font-display: 'Trocchi', rockwell, georgia, serif;
    --font-body: 'Open Sans', 'Helvetica Neue', arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.375rem;
    --font-size-2xl: 1.75rem;
    --font-size-3xl: 2.25rem;
    --font-size-4xl: 3rem;
    --font-size-hero: clamp(3rem, 7vw, 6rem);
    --font-size-kpi: clamp(3.25rem, 6vw, 5rem);
    --line-height-body: 1.6;
    --line-height-heading: 1.1;
    --line-height-kpi: 1;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;
    --space-9: 6rem;
    --space-10: 8rem;
    --radius-none: 0;
    --radius-sm: 2px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --shadow-none: none;
    --shadow-subtle: 0 2px 8px rgb(0 0 0 / 8%);
    --container-sm: 720px;
    --container-md: 960px;
    --container-lg: 1200px;
    --container-xl: 1360px;
    --target-min: 44px;
    --control-height: 48px;
    --border-width: 1px;
    --border-width-strong: 2px;
    --focus-width: 3px;
    --focus-offset: 3px;
    --tile-accent-width: 6px;
    --tile-min-height: 15rem;
    --status-dot-size: 0.75rem;
    --motion-duration: 180ms;
    --motion-lift: -2px;
    --primary-color: var(--color-brand-primary);
    --secondary-color: var(--color-brand-secondary);
    --light-primary: var(--color-brand-primary-soft);
    --light-secondary: var(--color-brand-secondary-soft);
    --dark-primary: #687800;
    --dark-secondary: var(--color-brand-secondary-hover);
    --success-color: var(--color-success);
    --warning-color: var(--color-warning);
    --danger-color: var(--color-error);
    --info-color: var(--color-info);
    --light-color: var(--color-surface-subtle);
    --dark-color: var(--color-text-primary);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--color-text-primary);
    font-family: var(--font-body);
    line-height: var(--line-height-body);
    background-color: var(--color-surface-warm);
}

/* Überschriften verwenden Trocchi */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Trocchi', serif;
    font-weight: 400;
}

/* Navbar Brand auch mit Trocchi */
.navbar-brand {
    font-family: 'Trocchi', serif !important;
}

/* Logo responsive Styling */
.navbar-brand img {
    max-height: 60px;
    width: auto;
}

@media (max-width: 576px) {
    .navbar-brand img {
        max-height: 50px;
    }
}

/* Logo in Hero-Bereichen */
.hero-section img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .hero-section img {
        height: 60px !important;
    }
}

/* Registration Logo with Background */
.registration-logo {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
}

@media (max-width: 768px) {
        .registration-logo { padding: var(--space-2); }
}

/* Header Styles */
.navbar {
    background-color: var(--color-white);
    box-shadow: none;
    border-bottom: 1px solid var(--color-border);
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: bold;
}

/* Custom Button Styles */
.btn-primary {
    background-color: var(--color-brand-secondary);
    border-color: var(--color-brand-secondary);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-brand-secondary-hover);
    border-color: var(--color-brand-secondary-hover);
    color: var(--color-white);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--color-brand-secondary);
    color: var(--color-brand-secondary);
}

.btn-secondary:hover {
    background-color: var(--color-brand-secondary-soft);
    border-color: var(--color-brand-secondary-hover);
    color: var(--color-brand-secondary-hover);
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible {
    box-shadow: 0 0 0 var(--focus-width) var(--color-focus);
    outline: var(--focus-width) solid var(--color-focus);
    outline-offset: var(--focus-offset);
}

/* stylelint-disable selector-class-pattern -- The approved navigation mockup defines these BEM component names. */
.admin-navigation {
    --font-display: 'Roboto Slab', rockwell, georgia, serif;
    --font-body: inter, 'Helvetica Neue', arial, sans-serif;

    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    font-family: var(--font-body);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-navigation__inner {
    align-items: center;
    display: flex;
    gap: var(--space-4);
    margin-inline: auto;
    min-height: 4.75rem;
    width: min(100% - 2rem, var(--container-lg));
}

.admin-navigation__brand {
    align-items: center;
    color: var(--color-text-primary);
    display: inline-flex;
    flex: 0 0 auto;
    text-decoration: none;
}

.admin-navigation__logo {
    display: block;
    height: auto;
    max-height: 3.25rem;
    object-fit: contain;
    width: 9.375rem;
}

.admin-navigation__menu-button {
    align-items: center;
    background: transparent;
    border: 2px solid var(--color-brand-secondary);
    color: var(--color-brand-secondary);
    cursor: pointer;
    display: none;
    font-weight: 700;
    justify-content: center;
    min-height: var(--target-min);
    min-width: var(--target-min);
    padding: var(--space-2) var(--space-3);
}

.admin-navigation__links {
    align-items: center;
    display: flex;
    gap: var(--space-1);
    margin-left: var(--space-3);
}

.admin-navigation__link {
    align-items: center;
    border-bottom: 4px solid transparent;
    color: var(--color-text-primary);
    display: inline-flex;
    font-size: var(--font-size-sm);
    font-weight: 700;
    justify-content: center;
    min-height: 4.75rem;
    padding-inline: var(--space-2);
    text-decoration: none;
    white-space: nowrap;
}

.admin-navigation__logout {
    align-items: center;
    color: var(--color-text-secondary);
    display: inline-flex;
    font-size: var(--font-size-sm);
    font-weight: 700;
    margin-left: auto;
    min-height: var(--target-min);
    padding-inline: var(--space-2);
    text-decoration: none;
    white-space: nowrap;
}

.admin-navigation__menu-button:focus-visible,
.admin-navigation__link:focus-visible,
.admin-navigation__brand:focus-visible,
.admin-navigation__logout:focus-visible {
    outline: var(--focus-width) solid var(--color-focus);
    outline-offset: var(--focus-offset);
}

.admin-navigation__link:hover,
.admin-navigation__link[aria-current="page"],
.admin-navigation__logout:hover {
    color: var(--color-brand-secondary);
}

.admin-navigation__link[aria-current="page"] {
    border-bottom-color: var(--color-brand-secondary);
}

@media (max-width: 1023px) {
    .admin-navigation__inner {
        flex-wrap: wrap;
        min-height: 4rem;
        padding-block: var(--space-3);
    }

    .admin-navigation__logo {
        width: 8.25rem;
    }

    .admin-navigation__menu-button {
        display: inline-flex;
        margin-left: auto;
    }

    .admin-navigation__links {
        align-items: stretch;
        border-top: 1px solid var(--color-border);
        flex-direction: column;
        gap: 0;
        margin-left: 0;
        order: 3;
        width: 100%;
    }

    .admin-navigation__link {
        border-bottom: 1px solid var(--color-border);
        justify-content: flex-start;
        min-height: 3.25rem;
        overflow-wrap: anywhere;
        padding-inline: 0;
        white-space: normal;
    }

    .admin-navigation__link[aria-current="page"] {
        border-bottom-color: var(--color-brand-secondary);
        border-bottom-width: 4px;
    }

    .admin-navigation__logout {
        justify-content: flex-start;
        margin-left: 0;
        order: 4;
        padding: var(--space-3) 0;
        width: 100%;
    }

    .admin-navigation.is-enhanced .admin-navigation__links:not(.is-open),
    .admin-navigation.is-enhanced .admin-navigation__logout:not(.is-open) {
        display: none;
    }
}
/* stylelint-enable selector-class-pattern */

/* Card Styles */
.card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: none;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
}

/* Form Styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(185, 196, 0, 0.25);
}

.form-control.is-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.8.8L7.8 3.5 7 2.7l-3.1 3.1-.8-.8L2.3 6.73z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 5.8 4.4 4.4M10.2 5.8l-4.4 4.4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.valid-feedback {
    display: block;
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Table Styles */
.table thead th {
    border-bottom: 2px solid var(--primary-color);
    background-color: white;
}

/* Alert Styles */
.alert-primary {
    background-color: var(--light-primary);
    border-color: var(--primary-color);
    color: var(--dark-primary);
}

.alert-secondary {
    background-color: var(--light-secondary);
    border-color: var(--secondary-color);
    color: var(--dark-secondary);
}

/* Custom Utilities */
.text-primary {
    color: var(--color-brand-secondary) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

/* Admin Dashboard Specific */
.dashboard-stats {
    padding: 1.5rem;
    border-radius: 0.5rem;
    background-color: white;
    margin-bottom: 1rem;
}

.dashboard-stats i {
    font-size: 2rem;
    color: var(--primary-color);
}

/* Registration Process Styles */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 2rem;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background-color: #dee2e6;
    z-index: 1;
}

.step.completed:not(:last-child)::after {
    background-color: var(--primary-color);
}

.step-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background-color: #dee2e6;
    color: #6c757d;
    font-weight: bold;
    position: relative;
    z-index: 2;
    margin-bottom: 0.5rem;
}

.step.active .step-number {
    background-color: var(--primary-color);
    color: white;
}

.step.completed .step-number {
    background-color: var(--primary-color);
    color: white;
}

.step.completed .step-number::after {
    content: '✓';
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

/* Registration Type Cards */
.registration-type-card {
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.registration-type-card:hover {
    border-color: var(--light-primary);
    background-color: #fafafa;
}

.registration-type-card.selected {
    border-color: var(--primary-color);
    background-color: var(--light-primary);
}

.registration-type-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Shift Selection Styles */
.day-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    overflow: hidden;
}

.day-header {
    background-color: var(--light-primary);
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.day-header h5 {
    color: var(--dark-primary);
    margin: 0;
}

.day-body {
    padding: 1rem;
}

.shift-item {
    border: 2px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shift-item:hover {
    border-color: var(--light-primary);
    background-color: #fafafa;
}

.shift-item.selected {
    border-color: var(--primary-color);
    background-color: var(--light-primary);
}

.shift-item.full {
    background-color: #f8d7da;
    border-color: #dc3545;
    cursor: not-allowed;
    opacity: 0.7;
}

.shift-item.insufficient {
    background-color: #fff3cd;
    border-color: #ffc107;
    cursor: not-allowed;
    opacity: 0.7;
}

.shift-item.limited {
    border-color: #ffc107;
}

.capacity-indicator {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    margin: 0.5rem 0;
    overflow: hidden;
}

.capacity-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.capacity-bar.full {
    background-color: #dc3545;
}

/* Selected Shifts Display */
.selected-shifts-display {
    background-color: var(--light-primary);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

/* Confirmation Summary */
.confirmation-summary {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Modal Styles */
.modal-header {
    background-color: var(--light-primary);
    border-bottom-color: var(--primary-color);
}

.modal-title {
    color: var(--dark-primary);
}

/* Week Navigation */
.week-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.week-navigation button {
    border: none;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
}

.week-navigation button:hover {
    background: var(--dark-primary);
}

.week-navigation button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .step-indicator {
        padding: 0 1rem;
    }
    
    .step-number {
        width: 25px;
        height: 25px;
        line-height: 25px;
        font-size: 0.875rem;
    }
    
    .step-text {
        font-size: 0.875rem;
    }
    
    .registration-type-card i {
        font-size: 2rem;
    }
    
    .day-card {
        margin-bottom: 0.75rem;
    }
    
    .shift-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
}

/* Special Shift Badge Styling */
.special-shift-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    z-index: 10;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 12px;
    padding: 4px 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.setup-badge {
    background: linear-gradient(135deg, #ff9500, #ff6b00);
    color: white;
}

.teardown-badge {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

/* Shift Item Layout Improvements */
.shift-header {
    position: relative;
    margin-bottom: 8px;
}

.shift-title {
    flex: 1;
    margin-right: 10px;
}

.status-badge {
    flex-shrink: 0;
    white-space: nowrap;
}

.shift-body {
    margin-top: 8px;
}

/* Shift Item Special Styling */
.shift-item.setup-shift {
    border-left: 4px solid #ff9500;
    background: linear-gradient(to right, rgba(255, 149, 0, 0.05), transparent);
}

.shift-item.teardown-shift {
    border-left: 4px solid #007bff;
    background: linear-gradient(to right, rgba(0, 123, 255, 0.05), transparent);
}

/* Mobile Modal Optimizations */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 0.375rem;
    }
    
    .modal-header {
        padding: 1rem;
        border-bottom: 1px solid #dee2e6;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 1rem;
        border-top: 1px solid #dee2e6;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    /* Mobile-friendly form elements in modals */
    .modal .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    .modal .btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* Stack modal buttons on mobile */
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .modal-footer .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Adjust modal positioning for mobile keyboards */
    .modal.show .modal-dialog {
        transform: translateY(0);
    }
}
