/* Adventor - Adventskalender Styling */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.calendar-subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

.calendar-meta,
header p {
    font-size: 1em;
    opacity: 0.85;
}

.calendar-meta {
    margin-top: 10px;
}

.admin-link {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s;
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Kalender Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* Türchen */
.door {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
}

.door:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.door.locked {
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    cursor: not-allowed;
}

.door.locked:hover {
    transform: none;
}

.door-number {
    font-size: 3em;
    font-weight: bold;
    color: #c41e3a;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.lock-icon {
    font-size: 2em;
    margin-top: 10px;
}

.door.openable {
    background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
}

.door.openable .door-number {
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

.door-content-text {
    font-size: 1.2em;
    line-height: 1.6;
    padding: 20px;
    text-align: center;
}

.door-content-audio {
    text-align: center;
    padding: 20px;
}

.door-content-audio h2 {
    margin-bottom: 20px;
    color: #c41e3a;
}

.door-content-audio audio {
    width: 100%;
    margin-top: 20px;
}

/* Setup & Login */
.setup-container,
.admin-login {
    max-width: 500px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.setup-container h1,
.admin-login h1 {
    text-align: center;
    color: #c41e3a;
    margin-bottom: 20px;
}

.setup-container p {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #c41e3a;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #c41e3a;
    color: white;
}

.btn-primary:hover {
    background: #8b0000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(196, 30, 58, 0.3);
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    margin-left: 10px;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #0a0;
    border: 1px solid #cfc;
}

/* Admin Panel */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    color: white;
}

.admin-header h1 {
    margin: 0;
}

.admin-doors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.admin-door-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.admin-door-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.admin-door-header h2 {
    color: #c41e3a;
    margin: 0;
}

.opening-count {
    background: #c41e3a;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

.current-file {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
        padding: 10px;
    }

    .door-number {
        font-size: 2em;
    }

    header h1 {
        font-size: 1.8em;
    }

    .admin-doors {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}
