/* Main Application Styles - Feuerwehr-Challenge NRW */

/* Challenge Status Overrides */
.challenge-completed {
    opacity: 0.7;
    border-color: var(--success) !important;
}

.challenge-completed .challenge-header .badge {
    background: var(--success) !important;
}

.challenge-cooldown {
    border-color: var(--warning) !important;
    position: relative;
}

.challenge-cooldown .challenge-header .badge {
    background: var(--warning) !important;
}

.challenge-card {
    transition: all 0.3s ease;
}

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

.challenge-completed:hover {
    transform: none !important;
    box-shadow: none !important;
}

.challenge-cooldown:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Quiz Question Styles - One at a time */
.quiz-container {
    max-width: 700px;
    margin: 0 auto;
}

.quiz-question-card {
    display: none;
    animation: fadeIn 0.4s ease;
}

.quiz-question-card.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.quiz-progress-bar {
    height: 4px;
    background: var(--glass-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ff-red), var(--ff-red-light));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.quiz-counter {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Nicer Radio Buttons */
.quiz-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.quiz-option:hover {
    border-color: var(--ff-red-light);
    background: rgba(211, 47, 47, 0.05);
}

.quiz-option.selected {
    border-color: var(--ff-red);
    background: rgba(211, 47, 47, 0.08);
}

.quiz-option input[type="radio"] {
    display: none;
}

.quiz-option .option-circle {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--glass-border-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quiz-option.selected .option-circle {
    border-color: var(--ff-red);
    background: var(--ff-red);
}

.quiz-option.selected .option-circle::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.quiz-option .option-letter {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    background: var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.quiz-option.selected .option-letter {
    background: var(--ff-red);
    color: white;
}

.quiz-option .option-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.quiz-submit-area {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

/* Season Countdown */
.countdown-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.countdown-item {
    text-align: center;
    min-width: 50px;
}

.countdown-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.countdown-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Layout */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 200px);
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 0;
    margin-bottom: 0;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-icon {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.nav-link.btn-primary {
    color: white;
}

.nav-login {
    color: var(--ff-red-light);
}

.nav-logout {
    color: var(--error);
}

.nav-user {
    margin-left: 0.5rem;
}

.user-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ff-red);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 50%;
}

.user-points {
    background: var(--glass-bg);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ff-red-light);
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-darker);
        padding: 1rem;
        gap: 0.5rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-user {
        margin-left: 0;
    }
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 2rem 0;
    text-align: center;
    border-radius: 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-tagline {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

/* Landing Page */
.landing-hero {
    text-align: center;
    padding: 4rem 1rem;
}

.landing-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--ff-red-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Dashboard */
.dashboard-welcome {
    margin-bottom: 2rem;
}

.dashboard-welcome h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dashboard-welcome p {
    color: var(--text-secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ff-red-light);
    display: block;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
    margin-left: 0.5rem;
}

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

.challenge-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.challenge-type {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    background: var(--glass-bg);
}

.challenge-type.theorie {
    background: rgba(33, 150, 243, 0.2);
    color: var(--info);
}

.challenge-type.praxis {
    background: rgba(255, 152, 0, 0.2);
    color: var(--warning);
}

.challenge-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.challenge-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex: 1;
}

.challenge-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.challenge-points {
    font-weight: 600;
    color: var(--ff-red-light);
}

/* Rankings */
.ranking-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.ranking-tab {
    padding: 0.75rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.ranking-tab:hover,
.ranking-tab.active {
    background: var(--ff-red);
    border-color: var(--ff-red);
    color: white;
}

.ranking-table {
    width: 100%;
}

.ranking-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    transition: background var(--transition-fast);
}

.ranking-row:hover {
    background: var(--glass-bg);
}

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

.ranking-position {
    width: 50px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.ranking-position.top-3 {
    color: var(--ff-red-light);
}

.ranking-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border-radius: 50%;
    margin-right: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.ranking-station {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ranking-points {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ff-red-light);
}

/* Auth Pages */
.auth-container {
    max-width: 450px;
    margin: 2rem auto;
}

.auth-card {
    padding: 2rem;
}

.auth-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--ff-red-light);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Admin Panels */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.admin-card {
    padding: 1.5rem;
}

.admin-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-list {
    list-style: none;
}

.admin-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.admin-list-item:last-child {
    border-bottom: none;
}

.pending-submission {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
}

.pending-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.pending-info {
    flex: 1;
}

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

/* Error Page */
.error-container {
    text-align: center;
    padding: 4rem 1rem;
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--ff-red);
    opacity: 0.5;
    line-height: 1;
}

.error-message {
    font-size: 1.5rem;
    margin: 1rem 0;
}

/* PWA Install Button */
#installButton {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: none;
}

#installButton.visible {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glass-border-hover);
}