/* ===== Variables ===== */
:root {
    --red-hat-red: #EE0000;
    --dark-bg: #0f0f1e;
    --dark-card: #1a1a2e;
    --dark-hover: #252540;
    --text-primary: #ffffff;
    --text-secondary: #b8b8d0;
    --success: #00ff88;
    --error: #ff4757;
    --warning: #ffa502;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Navbar ===== */
.navbar {
    background: var(--dark-card);
    border-bottom: 3px solid var(--red-hat-red);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(238, 0, 0, 0.1);
}

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

.nav-brand h1 {
    color: var(--red-hat-red);
    font-size: 1.5rem;
    margin: 0;
}

.nav-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: transparent;
    border: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-btn:hover {
    background: var(--dark-hover);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--red-hat-red);
    color: white;
    border-color: var(--red-hat-red);
}

/* ===== Main Container ===== */
.main-container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--red-hat-red), #ff5555);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.stat-card {
    background: var(--dark-card);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid rgba(238, 0, 0, 0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--red-hat-red);
    box-shadow: 0 10px 30px rgba(238, 0, 0, 0.2);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--red-hat-red);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== Buttons ===== */
.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--red-hat-red);
    color: white;
}

.btn-primary:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(238, 0, 0, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--red-hat-red);
}

.btn-secondary:hover {
    background: var(--red-hat-red);
    color: white;
}

/* ===== Features Section ===== */
.features-section {
    margin-top: 4rem;
}

.features-section h3 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--red-hat-red);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--dark-card);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.feature-card:hover {
    border-color: var(--red-hat-red);
    transform: translateY(-5px);
}

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

.feature-card h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

/* ===== Certifications Grid ===== */
h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--red-hat-red);
}

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.cert-card {
    background: var(--dark-card);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid rgba(238, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.cert-card:hover {
    border-color: var(--red-hat-red);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(238, 0, 0, 0.2);
}

.cert-card h3 {
    color: var(--red-hat-red);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.cert-code {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
}

.cert-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.cert-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(238, 0, 0, 0.2);
}

.cert-stat {
    text-align: center;
}

.cert-stat-value {
    color: var(--red-hat-red);
    font-weight: bold;
    font-size: 1.2rem;
}

.cert-stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ===== Practice View ===== */
.practice-header {
    margin-bottom: 2rem;
}

.practice-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.select-filter {
    flex: 1;
    min-width: 200px;
    padding: 0.8rem;
    background: var(--dark-card);
    color: var(--text-primary);
    border: 2px solid rgba(238, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-filter:hover,
.select-filter:focus {
    border-color: var(--red-hat-red);
    outline: none;
}

/* ===== Flashcard ===== */
.flashcard-container {
    animation: fadeIn 0.3s ease;
}

.flashcard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.flashcard-progress {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.flashcard-progress span {
    color: var(--red-hat-red);
    font-weight: bold;
}

.badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge.EASY {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success);
}

.badge.MEDIUM {
    background: rgba(255, 165, 2, 0.2);
    color: var(--warning);
}

.badge.HARD {
    background: rgba(255, 71, 87, 0.2);
    color: var(--error);
}

.flashcard {
    background: var(--dark-card);
    border-radius: 20px;
    padding: 3rem;
    border: 2px solid rgba(238, 0, 0, 0.2);
    margin-bottom: 2rem;
}

.flashcard-content h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.options-container {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.option-btn {
    background: var(--dark-hover);
    border: 2px solid rgba(238, 0, 0, 0.2);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 0.95rem;
}

.option-btn:hover {
    border-color: var(--red-hat-red);
    background: var(--dark-card);
}

.option-btn.selected {
    border-color: var(--red-hat-red);
    background: rgba(238, 0, 0, 0.1);
}

.option-btn.correct {
    border-color: var(--success);
    background: rgba(0, 255, 136, 0.1);
}

.option-btn.incorrect {
    border-color: var(--error);
    background: rgba(255, 71, 87, 0.1);
}

.explanation-container {
    background: rgba(238, 0, 0, 0.05);
    border-left: 4px solid var(--red-hat-red);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 2rem;
}

.explanation-container h4 {
    color: var(--red-hat-red);
    margin-bottom: 0.5rem;
}

.explanation-container p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.flashcard-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.practice-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-mini {
    text-align: center;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-value.correct {
    color: var(--success);
}

.stat-value.incorrect {
    color: var(--error);
}

/* ===== Guides ===== */
.guides-grid {
    display: grid;
    gap: 2rem;
}

.guide-card {
    background: var(--dark-card);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid rgba(238, 0, 0, 0.2);
}

.guide-card h3 {
    color: var(--red-hat-red);
    margin-bottom: 1rem;
}

.guide-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.guide-tips {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(238, 0, 0, 0.2);
}

.guide-tips h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.guide-tips ul {
    list-style: none;
    padding: 0;
}

.guide-tips li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.guide-tips li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

/* ===== Statistics Dashboard ===== */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.dashboard-card {
    background: var(--dark-card);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid rgba(238, 0, 0, 0.2);
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.dashboard-card h3 {
    color: var(--red-hat-red);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.progress-chart {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.progress-circle {
    position: relative;
    width: 200px;
    height: 200px;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: var(--red-hat-red);
}

.cert-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cert-progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--dark-hover);
    border-radius: 8px;
}

.cert-progress-name {
    color: var(--text-primary);
    font-weight: 500;
}

.cert-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(238, 0, 0, 0.2);
    border-radius: 4px;
    margin: 0 1rem;
    overflow: hidden;
}

.cert-progress-fill {
    height: 100%;
    background: var(--red-hat-red);
    transition: width 0.3s ease;
}

.cert-progress-percent {
    color: var(--red-hat-red);
    font-weight: bold;
    min-width: 50px;
    text-align: right;
}

.practice-history {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--dark-hover);
    border-radius: 8px;
    align-items: center;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
}

/* ===== Footer ===== */
.footer {
    background: var(--dark-card);
    border-top: 3px solid var(--red-hat-red);
    padding: 2rem;
    margin-top: 4rem;
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.footer-note {
    font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-menu {
        width: 100%;
    }

    .nav-btn {
        flex: 1;
        text-align: center;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .flashcard {
        padding: 1.5rem;
    }

    .flashcard-actions {
        flex-direction: column;
    }

    .practice-stats {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
