/* ===== CSS PROFESSIONAL VERSION ===== */
/* Author: Professional CSS Architecture */
/* Version: 2.0 */

/* ===== CUSTOM PROPERTIES (CSS VARIABLES) ===== */
:root {
    /* Color Palette - Primary */
    --primary-dark: #083d5d;
    --primary-medium: #065587;
    --primary-light: #1a8cff;
    --primary-gradient: linear-gradient(90deg, #1818da, #3a3aa7);
    
    /* Neutral Colors */
    --white: #ffffff;
    --white-transparent: rgba(255, 255, 255, 0.9);
    --light-bg: #f0f5ff;
    --light-gray: #f5f5f5;
    --medium-gray: #f8f9ff;
    --border-light: #eee;
    --text-dark: #333333;
    --text-medium: #666666;
    --text-light: #999999;
    
    /* Dark Mode Colors */
    --dark-bg: #121212;
    --dark-surface: #1e1e1e;
    --dark-card: #333333;
    --dark-text: #e0e0e0;
    --dark-border: #444444;
    --dark-transparent: rgba(18, 18, 18, 0.9);
    
    /* Accent Colors */
    --accent-red: #e63946;
    --accent-red-hover: #c1121f;
    --accent-orange: #ffaa00;
    --accent-green: #28a745;
    --accent-purple: #6f42c1;
    --accent-blue: #2525d1;
    
    /* Status Colors */
    --success: #28a745;
    --warning: #ffc107;
    --error: #dc3545;
    --info: #17a2b8;
    
    /* Spacing System */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    --space-3xl: 30px;
    --space-4xl: 40px;
    
    /* Typography */
    --font-primary: "Poppins", sans-serif;
    --font-secondary: Arial, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-2xl: 28px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 20px;
    --radius-full: 30px;
    --radius-round: 50%;
    
    /* Shadows */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.4s ease;
    
    /* Layout */
    --header-height-sm: 110px;
    --header-height-md: 90px;
    --sidebar-width: 250px;
    --topbar-height: 30px;
    --navbar-height: 80px;
    --container-max-width: 1400px;
}

/* ===== RESET & BASE STYLES ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    padding-top: var(--header-height-sm);
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-base);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== UTILITY CLASSES ===== */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* ===== HEADER SECTION ===== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--white-transparent);
    backdrop-filter: blur(4px);
    border-bottom: 1px solid var(--primary-dark);
    z-index: 999;
    transition: background-color var(--transition-base);
}

body.dark-mode .main-header {
    background: var(--dark-transparent);
    border-bottom-color: var(--dark-border);
}

/* Top Info Bar */
.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--topbar-height);
    padding: var(--space-xs) var(--space-lg);
    background-color: var(--primary-dark);
    color: var(--white);
    font-size: var(--font-size-xs);
    overflow: hidden;
    white-space: nowrap;
}

.info-text {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-text p {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.info-text p::after {
    content: "|";
    margin-left: var(--space-lg);
    color: rgba(255, 255, 255, 0.5);
}

.info-text p:last-child::after {
    content: none;
}

.header-links {
    display: flex;
    gap: var(--space-sm);
}

.header-links a {
    color: var(--white);
    transition: opacity var(--transition-base);
}

.header-links a:hover {
    opacity: 0.8;
}

/* Main Navigation */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--navbar-height);
    padding: var(--space-sm) var(--space-xl);
}

.logo {
    flex-shrink: 0;
}

.logo img {
    height: 60px;
    width: auto;
    max-height: 100%;
    transition: transform var(--transition-base);
}

.logo img:hover {
    transform: scale(1.05);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

/* Search Box */
.search-box {
    position: relative;
    width: 350px;
}

.search-box input {
    width: 100%;
    height: 30px;
    padding: var(--space-sm) 35px var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-xl);
    background: var(--white);
    box-shadow: 0 0 0 1px var(--primary-medium);
    font-size: var(--font-size-sm);
    outline: none;
    transition: all var(--transition-base);
}

.search-box input:focus {
    box-shadow: 0 0 0 2px var(--primary-light);
}

body.dark-mode .search-box input {
    background-color: var(--dark-card);
    color: var(--dark-text);
}

.search-box i {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dark);
    font-size: var(--font-size-md);
    pointer-events: none;
}

body.dark-mode .search-box i {
    color: var(--dark-text);
}

/* Main Navigation Links */
.main-nav {
    display: flex;
    gap: var(--space-xs);
    list-style: none;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    color: var(--text-dark);
    font-weight: 500;
    transition: all var(--transition-base);
}

.main-nav a:hover {
    color: var(--primary-dark);
    background-color: rgba(8, 61, 93, 0.05);
    border-radius: var(--radius-sm);
}

body.dark-mode .main-nav a {
    color: var(--dark-text);
}

body.dark-mode .main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Buttons */
.nav-buttons {
    display: flex;
    gap: var(--space-sm);
}

.btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    background-color: var(--primary-dark);
    color: var(--white);
    border-radius: var(--radius-xl);
    font-size: var(--font-size-sm);
    transition: all var(--transition-base);
}

.btn:hover {
    background-color: var(--primary-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--space-xl);
    color: var(--primary-dark);
    margin-left: var(--space-lg);
    transition: transform var(--transition-base);
}

.theme-toggle:hover {
    transform: rotate(15deg);
}

body.dark-mode .theme-toggle {
    color: var(--white);
}

/* Menu Toggle (Mobile) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--space-2xl);
    color: var(--primary-dark);
    z-index: 1000;
}

body.dark-mode .menu-toggle {
    color: var(--white);
}

/* ===== DROPDOWN MENU ===== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm) 0;
    list-style: none;
    display: none;
    z-index: 100;
}

body.dark-mode .dropdown-menu {
    background-color: var(--dark-card);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    padding: var(--space-sm) var(--space-lg);
}

.dropdown-menu a {
    font-size: var(--font-size-sm);
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height-sm);
    width: var(--sidebar-width);
    height: 120vh;
    background-color: var(--light-gray);
    padding-top: 50px;
    box-shadow: 6px 0 6px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-base);
    z-index: 1000;
}

body.dark-mode .sidebar {
    background-color: var(--dark-surface);
}

.menu {
    list-style: none;
}

.menu li {
    margin: var(--space-md) var(--space-sm);
    font-size: var(--font-size-lg);
    display: flex;
    align-items: center;
    color: var(--text-dark);
    transition: all var(--transition-base);
}

.menu li:hover {
    font-weight: bold;
    cursor: pointer;
}

.menu li:hover i {
    transform: scale(1.1);
}

.menu i {
    margin-right: var(--space-md);
    font-size: 22px;
    transition: transform var(--transition-base);
}

/* Icon Colors */
.home-icon { color: var(--error); }
.profile-icon { color: var(--accent-orange); }
.category-icon { color: orange; }
.purchase-icon { color: var(--success); }
.feedback-icon { color: black; }
.refund-icon { color: gold; }
.privacy-icon { color: gray; }
.terms-icon { color: darkgray; }
.rate-icon { color: orange; }
.logout-icon { color: var(--error); }

/* Sidebar Links */
.sidebar ul li {
    padding: 0 var(--space-xs);
    cursor: pointer;
    transition: background var(--transition-base);
}

.sidebar ul li:hover {
    background: rgba(28, 3, 3, 0.1);
    border: 1px solid #08584e;
    box-shadow: 1px 1px 4px #19d2bd;
}

body.dark-mode .sidebar ul li:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar ul li a {
    display: block;
    padding: var(--space-sm);
    color: var(--text-dark);
    border-radius: var(--radius-sm);
}

.sidebar ul li a.active {
    background-color: var(--accent-orange);
    color: var(--white);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 100px;
    left: 15px;
    font-size: 24px;
    background: var(--light-gray);
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    z-index: 1100;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle:hover {
    background-color: var(--border-light);
}

/* ===== MAIN CONTENT ===== */
.content-container {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    padding: var(--space-xl);
    margin-top: 50px;
}

/* Header Banner */
.header-banner {
    height: 150px;
    background: var(--primary-gradient);
    position: relative;
    margin-bottom: 120px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: var(--space-xl);
}

.test-card {
    margin-top: 160px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    text-align: center;
    width: 200px;
    position: relative;
    z-index: 1;
}

.test-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.test-card h3 {
    font-size: 1.1rem;
    margin: var(--space-sm) 0 var(--space-xs);
}

.test-card p {
    font-size: 0.9rem;
    margin: var(--space-xs) 0;
    display: flex;
    justify-content: space-between;
}

.test-card .price {
    font-weight: bold;
    color: #d1d9e6;
}

/* Buy Button */
.buy-button {
    display: block;
    width: 100px;
    margin: var(--space-sm) auto var(--space-xs);
    padding: var(--space-sm);
    background: var(--accent-red);
    color: var(--white);
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    font-weight: bold;
    transition: all var(--transition-base);
}

.buy-button:hover {
    background: var(--accent-red-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Course Details */
.course-details {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3xl);
    margin-bottom: var(--space-xl);
    justify-content: center;
    padding: 0 var(--space-xl);
    margin-top: -100px;
}

.detail-item {
    background: var(--white);
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius-full);
    font-weight: bold;
    color: var(--accent-blue);
    box-shadow: var(--shadow-md);
    font-size: 1.1rem;
}

body.dark-mode .detail-item {
    background-color: var(--dark-surface);
    color: var(--white);
}

/* Divider */
.divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    margin: var(--space-3xl) auto;
    width: 90%;
    max-width: 800px;
}

/* Description Section */
.description-section {
    margin: var(--space-xs) 0;
    padding: 0 var(--space-xl);
}

.section-title {
    color: var(--accent-blue);
    margin-bottom: var(--space-xl);
    font-size: 1.8rem;
    position: relative;
    padding-bottom: var(--space-sm);
    padding-left: var(--space-xl);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: var(--space-xl);
    width: 80px;
    height: 4px;
    background: var(--accent-blue);
    border-radius: var(--radius-sm);
}

body.dark-mode .section-title {
    color: var(--white);
}

body.dark-mode .section-title::after {
    background: var(--white);
}

.description-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    line-height: 1.8;
    border-left: 4px solid var(--accent-blue);
    margin: 0 auto;
    max-width: 1200px;
}

body.dark-mode .description-box {
    background-color: var(--dark-surface);
    color: var(--dark-text);
}

/* Test Grid */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-2xl);
    margin: var(--space-4xl) 0;
    padding: 0 var(--space-xl);
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
}

.test-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.test-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

body.dark-mode .test-item {
    background-color: var(--dark-surface);
}

.test-header {
    background: var(--primary-gradient);
    color: var(--white);
    padding: var(--space-lg) var(--space-xl);
}

.test-header h3 {
    font-size: 1.1rem;
    text-align: center;
}

.test-metrics {
    display: flex;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    background: var(--medium-gray);
}

body.dark-mode .test-metrics {
    background-color: rgba(255, 255, 255, 0.05);
}

.metric {
    text-align: center;
    padding: var(--space-sm);
    flex: 1;
}

.metric-value {
    font-weight: bold;
    font-size: 1rem;
    color: var(--accent-blue);
}

body.dark-mode .metric-value {
    color: var(--white);
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-medium);
}

.test-action {
    padding: var(--space-lg) var(--space-xl);
    text-align: center;
    border-top: 1px solid var(--border-light);
}

body.dark-mode .test-action {
    border-top-color: var(--dark-border);
}

/* Start Button */
.start-button {
    background: var(--accent-blue);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    padding: var(--space-sm) var(--space-3xl);
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.start-button:hover {
    background: #2a2aa0;
    transform: scale(1.05);
}

/* Section Parts */
.section-parts {
    margin-left: var(--sidebar-width);
    padding: var(--space-xl);
    transition: margin-left var(--transition-base);
}

/* ===== RESPONSIVE DESIGN ===== */
/* Large Desktop (1300px and above) */
@media (min-width: 1300px) {
    .container {
        max-width: 1400px;
    }
}

/* Desktop (1200px to 1299px) */
@media (max-width: 1299px) {
    .search-box {
        width: 300px;
    }
}

/* Small Desktop (992px to 1199px) */
@media (max-width: 1199px) {
    .search-box {
        width: 250px;
    }
}

/* Tablet Landscape (768px to 991px) */
@media (max-width: 991px) {
    :root {
        --header-height-sm: 90px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height-sm);
        left: -100%;
        width: 80%;
        height: calc(100vh - var(--header-height-sm));
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        transition: left var(--transition-base);
        box-shadow: 2px 0 10px rgba(105, 3, 3, 0.1);
        z-index: 998;
        overflow-y: auto;
        padding: var(--space-xl);
    }

    body.dark-mode .nav-menu {
        background-color: var(--dark-bg);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu .search-box {
        width: 100%;
        margin-bottom: var(--space-xl);
    }

    .main-nav {
        flex-direction: column;
        width: 100%;
    }

    .main-nav a {
        width: 100%;
    }

    .nav-buttons {
        flex-direction: column;
        width: 100%;
    }

    .info-text {
        font-size: var(--font-size-xs);
        gap: var(--space-sm);
    }

    .info-text p::after {
        margin-left: var(--space-sm);
    }

    .header-links {
        display: none;
    }

    /* Sidebar Responsive */
    .sidebar {
        transform: translateX(-100%);
        height: calc(100vh - 60px);
        top: calc(var(--header-height-sm) - 20px);
        width: 80%;
        max-width: 300px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
        top: 110px;
    }

    .content-container {
        width: 100%;
        margin-left: 0;
    }

    .header-banner {
        margin-bottom: 180px;
        justify-content: center;
        padding-right: 0;
    }

    .section-parts {
        margin-left: 0;
    }
}

/* Tablet Portrait (576px to 767px) */
@media (max-width: 767px) {
    :root {
        --header-height-sm: 106px;
    }

    .nav-menu {
        width: 100%;
    }

    .logo img {
        height: 50px;
    }

    .sidebar {
        width: 80%;
        max-width: 300px;
        top: 106px;
    }

    .sidebar-toggle {
        top: 90px;
    }

    .header-banner {
        margin-bottom: 180px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding-top: var(--space-xl);
    }

    .course-details {
        flex-direction: column;
        align-items: center;
        gap: var(--space-lg);
    }

    .detail-item {
        padding: var(--space-sm) var(--space-lg);
        font-size: 1rem;
    }

    .test-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .description-section {
        padding: 0 var(--space-lg);
    }
}

/* Mobile (480px to 575px) */
@media (max-width: 575px) {
    :root {
        --header-height-sm: 100px;
        --navbar-height: 70px;
    }

    .header-info {
        height: 25px;
        font-size: 9px;
    }

    .logo img {
        height: 40px;
    }

    .btn {
        padding: var(--space-xs) var(--space-md);
        font-size: 13px;
    }

    .info-text {
        gap: var(--space-xs);
    }

    .info-text p::after {
        margin-left: var(--space-xs);
    }

    .sidebar {
        width: 85%;
    }

    .menu li {
        padding: var(--space-sm);
        font-size: var(--font-size-md);
    }

    .menu i {
        font-size: var(--font-size-md);
        margin-right: var(--space-sm);
    }

    .header-banner {
        height: 200px;
        margin-bottom: 200px;
    }

    .test-card {
        width: 180px;
    }

    .section-title {
        font-size: var(--font-size-xl);
        padding-left: var(--space-sm);
    }

    .section-title::after {
        left: var(--space-sm);
    }

    .test-grid {
        grid-template-columns: 1fr;
    }

    .description-box {
        padding: var(--space-lg);
        font-size: 0.9rem;
    }

    .section-parts {
        padding: var(--space-sm);
    }
}

/* Small Mobile (below 480px) */
@media (max-width: 479px) {
    .header-banner {
        height: 180px;
        margin-bottom: 220px;
    }

    .test-card {
        width: 160px;
    }

    .section-title {
        font-size: 20px;
    }

    .detail-item {
        font-size: 0.9rem;
        padding: var(--space-xs) var(--space-lg);
    }
}

/* Print Styles */
@media print {
    .main-header,
    .sidebar,
    .sidebar-toggle,
    .menu-toggle,
    .theme-toggle,
    .nav-buttons,
    .buy-button,
    .start-button {
        display: none !important;
    }

    body {
        padding-top: 0;
        background: white;
        color: black;
    }

    .content-container,
    .section-parts {
        margin-left: 0;
        width: 100%;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus Styles for Accessibility */
:focus-visible {
    outline: 2px solid var(--primary-medium);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (forced-colors: active) {
    .btn,
    .buy-button,
    .start-button {
        border: 1px solid currentColor;
    }
}