:root {
    --primary: #4169E1; /* Royal Blue - Communication, Professionalism */
    --primary-dark: #3048A0;
    --secondary: #FFD700; /* Gold - Prestige, Value */
    --accent: #008080; /* Teal - Trust, Clarity */
    --light: #f8fafc;
    --dark: #1E3A8A;
    --gray: #6B7280;
    --gray-light: #e2e8f0;
    --success: #10B981;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Chapter-specific ribbon colors for Public Relations Management (12 chapters) */
    --chap-1: #4169E1; /* Royal Blue */
    --chap-2: #4682B4; /* Steel Blue */
    --chap-3: #5D8AA8; /* Air Force Blue */
    --chap-4: #007FFF; /* Azure */
    --chap-5: #008080; /* Teal */
    --chap-6: #40E0D0; /* Turquoise */
    --chap-7: #00CED1; /* Dark Turquoise */
    --chap-8: #48D1CC; /* Medium Turquoise */
    --chap-9: #20B2AA; /* Light Sea Green */
    --chap-10: #008B8B; /* Dark Cyan */
    --chap-11: #2E8B57; /* Sea Green */
    --chap-12: #3CB371; /* Medium Sea Green */
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #0f172a;
        --dark: #e2e8f0;
        --gray: #94a3b8;
        --gray-light: #1e293b;
        --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.4);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.app-container {
    min-height: 100vh;
    width: 100%;
}

/* Header - Fixed alignment */
.content-header {
    padding: 20px 30px;
    background: white;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 99;
    min-height: 80px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 5px;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 2px;
}

.main-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
}

.main-subtitle {
    font-size: 0.95rem;
    color: var(--gray);
    line-height: 1.4;
}

.header-logo {
    height: 60px;
    width: auto;
}

/* QUIZ BUTTON STYLES */
.quiz-btn {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 18px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: transparent;
}

.quiz-btn:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(65, 105, 225, 0.25);
}

/* Floating Home Button */
.floating-home-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(65, 105, 225, 0.4);
    transition: var(--transition);
    z-index: 1000;
    border: 2px solid white;
    animation: float 3s ease-in-out infinite;
}

.floating-home-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(65, 105, 225, 0.6);
    animation: none;
}

.floating-home-btn:active {
    transform: translateY(-2px) scale(1.05);
}

.floating-home-btn i {
    font-size: 1.5rem;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

/* Main Content */
.main-content {
    padding: 30px;
    background: var(--light);
    -webkit-overflow-scrolling: touch;
}

.welcome-section {
    background: white;
    border-radius: var(--radius);
    padding: 25px 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: block;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 18px 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--gray-light);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* RESUME SECTION */
#resume-container {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 2px solid var(--primary-dark);
    color: white;
    position: relative;
    overflow: hidden;
}

#resume-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
    z-index: 1;
}

.resume-button-simple {
    display: flex;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 25px 30px;
    text-decoration: none;
    font-size: 1em;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.resume-button-simple:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.resume-simple-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
}

.resume-icon {
    font-size: 2rem;
    margin-right: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.resume-text {
    flex: 1;
    text-align: left;
}

.resume-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
}

.resume-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

.resume-arrow {
    font-size: 1.5rem;
    margin-left: 20px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.resume-button-simple:hover .resume-arrow {
    transform: translateX(5px);
}

/* Chapters Section */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
    margin: 35px 0 20px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Base Chapter Card Styles - Professional Ribbon Design */
.chapter-card {
    background: white;
    border-radius: var(--radius);
    padding: 22px 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--gray-light);
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

/* Color Ribbon on Top */
.chapter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--ribbon-color, var(--primary));
    z-index: 2;
    transition: height 0.3s ease;
}

/* Light gradient overlay that appears on hover */
.chapter-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(var(--ribbon-rgb, 65, 105, 225), 0.05) 30%,
        rgba(var(--ribbon-rgb, 65, 105, 225), 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
    pointer-events: none;
}

.chapter-card > * {
    position: relative;
    z-index: 1;
}

.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--ribbon-color, var(--primary));
}

.chapter-card:hover::before {
    height: 6px;
}

.chapter-card:hover::after {
    opacity: 1;
}

.chapter-card.touch-active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: var(--shadow);
    border-color: var(--ribbon-color, var(--primary));
}

/* Chapter-specific ribbon color assignments for Public Relations Management */
.chapter-card[data-name*="Chapter 1"] { --ribbon-color: var(--chap-1); --ribbon-rgb: 65, 105, 225; }
.chapter-card[data-name*="Chapter 2"] { --ribbon-color: var(--chap-2); --ribbon-rgb: 70, 130, 180; }
.chapter-card[data-name*="Chapter 3"] { --ribbon-color: var(--chap-3); --ribbon-rgb: 93, 138, 168; }
.chapter-card[data-name*="Chapter 4"] { --ribbon-color: var(--chap-4); --ribbon-rgb: 0, 127, 255; }
.chapter-card[data-name*="Chapter 5"] { --ribbon-color: var(--chap-5); --ribbon-rgb: 0, 128, 128; }
.chapter-card[data-name*="Chapter 6"] { --ribbon-color: var(--chap-6); --ribbon-rgb: 64, 224, 208; }
.chapter-card[data-name*="Chapter 7"] { --ribbon-color: var(--chap-7); --ribbon-rgb: 0, 206, 209; }
.chapter-card[data-name*="Chapter 8"] { --ribbon-color: var(--chap-8); --ribbon-rgb: 72, 209, 204; }
.chapter-card[data-name*="Chapter 9"] { --ribbon-color: var(--chap-9); --ribbon-rgb: 32, 178, 170; }
.chapter-card[data-name*="Chapter 10"] { --ribbon-color: var(--chap-10); --ribbon-rgb: 0, 139, 139; }
.chapter-card[data-name*="Chapter 11"] { --ribbon-color: var(--chap-11); --ribbon-rgb: 46, 139, 87; }
.chapter-card[data-name*="Chapter 12"] { --ribbon-color: var(--chap-12); --ribbon-rgb: 60, 179, 113; }

.chapter-icon {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 12px;
    transition: var(--transition);
}

.chapter-card:hover .chapter-icon {
    color: var(--ribbon-color, var(--primary));
    transform: scale(1.1);
}

.chapter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.chapter-card:hover .chapter-title {
    color: var(--dark);
}

.chapter-desc {
    font-size: 0.8rem;
    color: var(--gray);
    line-height: 1.4;
    transition: color 0.3s ease;
}

.chapter-card:hover .chapter-desc {
    color: var(--dark);
}

footer {
    padding: 25px;
    text-align: center;
    background: white;
    border-top: 1px solid var(--gray-light);
    color: var(--gray);
    font-size: 0.95rem;
}

.heart {
    color: var(--secondary);
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    5% { transform: scale(1.1); }
    10% { transform: scale(1); }
    15% { transform: scale(1.1); }
    20% { transform: scale(1); }
    100% { transform: scale(1); }
}

/* =========================================== */
/* MOBILE RESPONSIVE HIDING RULES */
/* =========================================== */

/* Hide logo on tablets and mobiles (768px and below) */
@media (max-width: 768px) {
    .header-logo {
        display: none !important;
    }
}

/* Hide welcome section on mobile */
@media (max-width: 768px) {
    .welcome-section {
        display: none !important;
    }
    
    .section-title {
        margin-top: 20px;
    }
    
    .main-content {
        padding-top: 20px;
    }
}

/* Mobile fixes for simplified resume section */
@media (max-width: 768px) {
    #resume-container {
        margin-bottom: 18px;
    }
    
    .resume-button-simple {
        padding: 20px 25px;
    }
    
    .resume-simple-content {
        max-width: 100%;
    }
    
    .resume-icon {
        font-size: 1.8rem;
        margin-right: 15px;
    }
    
    .resume-title {
        font-size: 1.2rem;
    }
    
    .resume-subtitle {
        font-size: 0.95rem;
    }
    
    .resume-arrow {
        font-size: 1.3rem;
        margin-left: 15px;
        font-weight: bold;
        transition: transform 0.3s ease;
    }
    
    .resume-button-simple:hover .resume-arrow {
        transform: translateX(5px);
    }
}

@media (max-width: 480px) {
    .resume-button-simple {
        padding: 18px 20px;
    }
    
    .resume-icon {
        font-size: 1.5rem;
        margin-right: 12px;
    }
    
    .resume-title {
        font-size: 1.1rem;
    }
    
    .resume-subtitle {
        font-size: 0.9rem;
    }
    
    .resume-arrow {
        font-size: 1.2rem;
        margin-left: 12px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-header {
        padding: 15px 20px;
        min-height: auto;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    /* LEFT HEADER (Mobile) - Order 1 ensures title is FIRST */
    .header-left {
        order: 1;
        padding-top: 0;
        align-items: center;
        width: 100%;
    }

    /* RIGHT HEADER (Mobile) - Order 2 ensures button is SECOND */
    .header-right {
        order: 2;
        padding-top: 0;
        justify-content: center;
        width: 100%;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    /* Full width quiz button for mobile */
    .quiz-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    .main-content {
        padding: 20px;
    }

    .main-title {
        font-size: 1.5rem;
    }

    .main-subtitle {
        font-size: 0.85rem;
    }

    .stat-card {
        padding: 15px 10px;
    }

    .stat-number {
        font-size: 1.4rem;
        margin-bottom: 5px;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .section-title {
        font-size: 1.4rem;
        margin: 30px 0 15px;
    }

    .section-title::after {
        bottom: -6px;
    }

    .chapters-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .chapter-card {
        padding: 20px 15px;
        min-height: 130px;
    }

    .chapter-icon {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .chapter-title {
        font-size: 0.9rem;
    }

    .chapter-desc {
        font-size: 0.75rem;
    }

    /* Floating button mobile adjustments */
    .floating-home-btn {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }

    .floating-home-btn i {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .content-header {
        padding: 15px 15px;
        gap: 12px;
    }
    
    .main-title {
        font-size: 1.3rem;
    }

    .main-subtitle {
        font-size: 0.8rem;
    }

    .main-content {
        padding: 15px;
    }

    .chapters-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .chapter-card {
        padding: 15px;
        min-height: 120px;
    }

    .chapter-icon {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }

    .chapter-title {
        font-size: 0.85rem;
    }

    .chapter-desc {
        font-size: 0.7rem;
    }

    /* Very small screen floating button */
    .floating-home-btn {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }

    .floating-home-btn i {
        font-size: 1.2rem;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .heart {
        animation: none;
    }
    
    .floating-home-btn {
        animation: none;
    }
    
    .resume-icon {
        animation: none;
    }
    
    .resume-button-simple:hover .resume-arrow {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .welcome-section, .stat-card, .chapter-card, footer, .content-header {
        background: #1e293b;
        color: #e2e8f0;
        border-color: #334155;
    }

    body {
        background-color: #0f172a;
        color: #e2e8f0;
    }

    .main-title, .section-title {
        color: #e2e8f0;
    }
    
    .chapter-card:hover {
        border-color: var(--ribbon-color, var(--primary));
    }
    
    #resume-container {
        background: linear-gradient(135deg, #3048A0, #1E3A8A);
        border-color: #1E3A8A;
    }
    
    /* Quiz Button Dark Mode */
    .quiz-btn {
        color: #e2e8f0;
        border-color: var(--primary);
    }
    
    .quiz-btn:hover {
        background-color: var(--primary);
        color: white;
    }

    .floating-home-btn {
        background: var(--primary-dark);
        border: 2px solid #1e293b;
    }
    
    .stat-label, .main-subtitle, .chapter-desc, footer {
        color: #94a3b8;
    }

    .stat-number {
        color: #60a5fa;
    }

    .chapter-icon {
        color: #e2e8f0;
    }
    
    .chapter-card:hover .chapter-icon {
        color: var(--ribbon-color, #60a5fa);
    }
    
    .chapter-title, .chapter-card:hover .chapter-title {
        color: #e2e8f0;
    }
    
    .chapter-desc, .chapter-card:hover .chapter-desc {
        color: #94a3b8;
    }
}