@import '../variables.css';
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--container-background);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.backup-section {
    margin-bottom: 2rem;
    padding: 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 85%, white);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

/* Form-Gruppen */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Label-Styling */
label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    transition: color var(--transition-base);
}

.required-field::after {
    content: " *";
    color: var(--accent-primary);
    font-weight: 600;
}

/* Verbesserte Card-Überschriften */
.card h2 {
    color: var(--text-color);
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.card h3 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Basis-Styling für alle Input-Felder */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="file"] {
    background: var(--inner-container-background);
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-color);
    transition: all var(--transition-base);
    font-family: inherit;
}

/* Hover-Effekte für alle Input-Felder */
input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="file"]:hover {
    border-color: var(--accent-secondary);
    background: var(--card-hover);
}

/* Focus-Effekte für alle Input-Felder */
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--inner-container-background);
}

/* Disabled Input-Felder */
input[readonly] {
    background: var(--light-elements);
    color: var(--text-secondary);
    cursor: not-allowed;
    border-color: var(--border-color);
}

input[readonly]:hover {
    border-color: var(--border-color);
    background: var(--light-elements);
}

.times-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem 0;
}

/* Spezielle Styles für Zeit-Input-Felder */
input[type="time"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--inner-container-background);
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-base);
}

input[type="time"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[type="time"]:hover {
    border-color: var(--accent-secondary);
}

.times-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.day-row {
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 75%, white);
}

.day-row:last-child {
    border-bottom: none;
}

/* Checkbox-Styling */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color var(--transition-base);
}

.checkbox-wrapper:hover {
    background-color: var(--card-hover);
}

.preference-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preference-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.preference-group {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    background: var(--inner-container-background);
}

.preference-group legend {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 0 0.5rem;
}

.preference-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.preference-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.preference-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--container-background);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-color);
}

.preference-option input {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--accent-primary);
}

.preference-option:hover {
    border-color: var(--accent-secondary);
    background: var(--card-hover);
}

.preference-option--checkbox {
    justify-content: flex-start;
    margin-top: 0.5rem;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.checkbox-wrapper label {
    margin-bottom: 0;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 400;
}

/* Geschlossene Tage Grid */
.closed-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Button-Styling */
.button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.button-primary {
    background: var(--accent-primary);
    color: white;
    display: block;
    margin: 2rem auto 0;
    min-width: 200px;
    box-shadow: var(--shadow-sm);
}

.button-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.button-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.button-subtle {
    background-color: var(--inner-container-background);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.button-subtle:hover {
    background-color: var(--card-hover);
    border-color: var(--accent-secondary);
    color: var(--text-color);
    transform: translateY(-1px);
}

#backupFile {
    display: none;
}

/* Select-Styling für Zeit-Dropdowns */
select.time-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--inner-container-background);
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

select.time-select:hover {
    border-color: var(--accent-secondary);
    background-color: var(--card-hover);
}

select.time-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: var(--inner-container-background);
}

.day-closed {
    background-color: color-mix(in srgb, var(--danger-color) 12%, white);
    border-radius: 6px;
}
@media (prefers-color-scheme: dark) {
    .day-closed {
        background: color-mix(in srgb, var(--danger-color) 85%, black);
    }
  }
  

.day-closed select.time-select {
    background-color: color-mix(in srgb, var(--danger-color) 24%, white);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    .card {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .card h2 {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    /* Input-Felder auf Mobile */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="file"] {
        padding: 0.875rem;
        font-size: 0.9rem;
    }

    /* Zeit-Grid auf Mobile */
    .times-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .times-header {
        display: none;
    }

    /* Button auf Mobile */
    .button-primary {
        width: 100%;
        margin: 1.5rem 0 0;
        min-width: unset;
        padding: 1rem;
        font-size: 1rem;
    }

    /* Checkbox-Grid auf Mobile */
    .closed-days-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .preference-group {
        padding: 1.25rem;
    }

    .preference-options {
        flex-direction: column;
    }

    .preference-option {
        width: 100%;
    }

    .checkbox-wrapper {
        padding: 0.75rem;
    }

    /* Backup-Section auf Mobile */
    .backup-section {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 0.75rem;
    }

    .button-subtle {
        width: 100%;
        margin-top: 0.5rem;
        justify-content: center;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }

    .card {
        padding: 1rem;
        border-radius: 8px;
    }

    h1 {
        font-size: 1.375rem;
    }

    .closed-days-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .holiday-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .holiday-item-preview {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
}
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-modal);
    opacity: 0;
    animation: fadeIn var(--transition-base) forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.popup {
    background: var(--card-color);
    color: var(--text-color);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(20px);
    animation: slideIn var(--transition-base) forwards;
}

@keyframes slideIn {
    to { transform: translateY(0); }
}

.popup h3 {
    color: var(--text-color);
    margin-bottom: var(--spacing-lg);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.steps {
    margin: var(--spacing-xl) 0;
    gap: var(--spacing-lg);
    display: flex;
    flex-direction: column;
}

.step {
    background: var(--inner-container-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: left;
    transition: all var(--transition-base);
}

.step:hover {
    background: var(--card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.step h4 {
    color: var(--accent-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.step h4::before {
    content: "➤";
    color: var(--accent-secondary);
    font-weight: bold;
}

.step p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
    margin: 0;
}

.popup button {
    width: 100%;
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.popup button:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.popup button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
    .popup {
        margin: var(--spacing-md);
        padding: var(--spacing-lg);
        max-height: 85vh;
    }

    .popup h3 {
        font-size: 1.1rem;
    }

    .step {
        padding: var(--spacing-md);
    }

    .step h4 {
        font-size: 0.95rem;
    }

    .step p {
        font-size: 0.85rem;
    }
}

/* Holiday Preview Styles */
.holiday-preview {
    margin-top: 1rem;
}

.holiday-preview h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.holiday-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.holiday-item-preview {
    background: var(--inner-container-background);
    border: 1px solid color-mix(in srgb, var(--border-color) 85%, white);
    border-radius: 6px;
    padding: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-color);
    transition: background-color 0.2s;
}

.holiday-item-preview:hover {
    background-color: color-mix(in srgb, var(--card-color) 90%, white);
}

@media (prefers-color-scheme: dark) {
    .holiday-item-preview:hover {
        background-color: var(--table-hover-color);
    }
}

@media (max-width: 640px) {
    .holiday-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.5rem;
    }
    
    .holiday-item-preview {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

/* Loading Animation Styles */
.backup-loading {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.backup-loading-message {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-color);
    font-weight: 500;
}

.backup-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-primary);
    border-radius: var(--radius-round);
    animation: backup-spin 1s linear infinite;
}

@keyframes backup-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.backup-loading-details {
    margin-top: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.backup-loading-progress {
    margin-top: var(--spacing-sm);
    height: 4px;
    background: var(--light-elements);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.backup-loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    animation: backup-progress 2s ease-in-out infinite;
}

@keyframes backup-progress {
    0% { width: 10%; }
    50% { width: 80%; }
    100% { width: 10%; }
}

/* Button loading state */
.button.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: var(--radius-round);
    animation: backup-spin 1s linear infinite;
    color: white;
}

.button-subtle.loading::after {
    color: var(--text-secondary);
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .backup-loading {
        border-color: var(--border-color);
    }
    
    .backup-loading-spinner {
        border-color: var(--border-color);
        border-top-color: var(--accent-primary);
    }
}

/* Reduced motion support for loading animations */
@media (prefers-reduced-motion: reduce) {
    .backup-loading-spinner,
    .backup-loading-progress-bar,
    .button.loading::after {
        animation: none;
    }
    
    .backup-loading-spinner {
        border: 2px solid var(--accent-primary);
        border-radius: var(--radius-round);
    }
    
    .backup-loading-progress-bar {
        width: 100%;
    }
}

.standard-time-hint {
    display: block;
    margin: -0.25rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
