/* Modern 2026 Design - Vom Regen in die Traube */

:root {
    --primary-color: #8b5cf6;
    --secondary-color: #ec4899;
    --background-dark: #0a0a0a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --shadow-color: rgba(139, 92, 246, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--background-dark);
    color: var(--text-primary);
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Container */
.container {
    text-align: center;
    padding: 2rem;
    max-width: 900px;
    width: 90%;
    position: relative;
    z-index: 1;
}

/* Glass Card Effect */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 3rem 2rem;
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.37),
        0 0 60px var(--shadow-color);
    animation: cardFloat 6s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Header Image */
.header-image {
    margin-bottom: 2rem;
    position: relative;
}

.header-image img {
    max-width: 100%;
    max-height: 60vh;
    height: auto;
    object-fit: contain;
    border-radius: 20px;
    filter: drop-shadow(0 10px 30px rgba(139, 92, 246, 0.3));
    transition: transform 0.3s ease;
}

.header-image img:hover {
    transform: scale(1.02);
}

/* Title */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
    background-size: 200% 200%;
    letter-spacing: -0.02em;
}

/* Target Date Display */
.target-date {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text-secondary);
    margin: 0.5rem 0 1rem 0;
    font-weight: 500;
    letter-spacing: 0.02em;
    opacity: 0.9;
}

/* ICS Download Button */
.ics-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    margin: 0 0 1.5rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
}

.ics-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, #9d6fff, #f260ab);
}

.ics-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Countdown */
#countdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
}

.countdown-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.countdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    transition: left 0.5s ease;
}

.countdown-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.countdown-item:hover::before {
    left: 100%;
}

.countdown-number {
    display: block;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.countdown-label {
    display: block;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* Expired Message */
.expired-message {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Loading State */
.loading {
    font-size: 1.2rem;
    color: var(--text-secondary);
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .glass-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    #countdown {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .countdown-item {
        padding: 1rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 1rem;
    }
    
    #countdown {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Admin Button (for admin.html) */
.admin-form {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 500px;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

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

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    text-align: center;
}

.message.success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.back-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--secondary-color);
    transform: translateX(-5px);
}

/* ==========================================================================
   PWA, Push-Benachrichtigungen & erweiterter Admin-Bereich
   ========================================================================== */

[hidden] {
    display: none !important;
}

/* Aktions-Buttons auf der Startseite */
.action-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.action-row .ics-button {
    margin: 0;
}

.ics-button:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: -0.5rem auto 1.25rem;
    max-width: 520px;
    line-height: 1.5;
}

/* Admin-Layout */
.admin-container {
    max-width: 760px;
}

.admin-card {
    animation: none;
}

.admin-form .section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 1rem;
    padding-top: 0.25rem;
    text-align: left;
    color: var(--text-primary);
}

.admin-form .form-group + .section-title,
.admin-form .reminder-list + .section-title {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.sub-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    text-align: left;
}

.help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 1rem;
    text-align: left;
}

.help a {
    color: var(--primary-color);
}

code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.1em 0.35em;
    border-radius: 5px;
    word-break: break-all;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 1rem;
    cursor: pointer;
}

.checkbox-label input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.checkbox-label.compact {
    margin: 0;
    white-space: nowrap;
}

.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: vertical;
}

.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.btn + .btn {
    margin-top: 0.75rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25);
    border-color: var(--primary-color);
}

.btn-small {
    width: auto;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

/* Erinnerungen */
.reminder-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.reminder-row {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-align: left;
}

.reminder-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.reminder-when {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.reminder-when-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.reminder-row input[type="text"],
.reminder-row input[type="number"],
.reminder-row select {
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.reminder-row input:focus,
.reminder-row select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.reminder-row input[type="number"] {
    width: 5rem;
}

.reminder-row input[type="text"] {
    width: 100%;
}

.reminder-row select {
    padding-right: 0.5rem;
}

.r-remove {
    margin-left: auto;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.r-remove:hover {
    color: #f87171;
    border-color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

.reminder-status {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.reminder-status.status-sent    { color: #4ade80; }
.reminder-status.status-due     { color: #60a5fa; }
.reminder-status.status-missed,
.reminder-status.status-skipped { color: #fbbf24; }
.reminder-status.status-invalid { color: #f87171; }

/* Status-Bereich */
.status-box {
    margin-top: 1.25rem;
    text-align: left;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-value.small {
    font-size: 0.95rem;
    -webkit-text-fill-color: var(--text-primary);
    background: none;
}

.input-row {
    display: flex;
    gap: 0.5rem;
}

.input-row input {
    flex: 1;
    min-width: 0;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.85rem;
}

.table-wrap {
    overflow-x: auto;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.log-table th,
.log-table td {
    padding: 0.5rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.log-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.log-table td:nth-child(3) {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-slot:empty {
    display: none;
}

@media (max-width: 480px) {
    .reminder-head {
        gap: 0.5rem;
    }
    .input-row {
        flex-direction: column;
    }
    .input-row .btn-small {
        width: 100%;
    }
}
