/* ==========================================================================
   DIGITAL PORTFOLIO - DESIGN SYSTEM
   Student: Nguyễn Thanh Tuấn (VNU-UET)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Font Families */
    --font-heading: 'Playfair Display', sans-serif;
    --font-body: 'Open Sans', sans-serif;

    /* Theme: Soft Black Slate Light (Default and Only Theme) */
    --bg-primary: #f1f5f9;
    --bg-secondary: #e2e8f0;
    --bg-sidebar: rgba(255, 255, 255, 0.95);
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(15, 23, 42, 0.08);
    --card-hover-border: rgba(2, 132, 199, 0.35);
    
    --text-primary: #0f172a;      /* Charcoal Dark Text */
    --text-secondary: #334155;    /* Slate 700 - Highly readable */
    --text-muted: #64748b;        /* Slate 500 */
    
    --accent-primary: #0284c7;    /* Slate Dark Ocean */
    --accent-secondary: #2563eb;
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    --accent-glow: rgba(2, 132, 199, 0.15);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --sidebar-width: 280px;
    --transition-speed: 0.3s;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --glass-blur: blur(20px);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

p, li {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-secondary);
}

ul {
    list-style-position: inside;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Shared Layout Structure */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform var(--transition-speed) ease, background-color var(--transition-speed), border-color var(--transition-speed);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sidebar-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    padding: 3px;
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    box-shadow: 0 0 15px var(--accent-glow);
    object-fit: cover;
    transition: transform 0.5s ease;
}

.sidebar-avatar:hover {
    transform: rotate(360deg);
}

.sidebar-title {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    color: var(--text-secondary);
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.menu-item svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.menu-item:hover, .menu-item.active {
    color: var(--text-primary);
    background-color: var(--card-bg);
    border-left: 3px solid var(--accent-primary);
    padding-left: calc(1rem - 3px);
}

.menu-item.active {
    box-shadow: inset 0 0 10px rgba(14, 165, 233, 0.05);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Theme Switcher Button */
.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 3rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    transition: margin var(--transition-speed) ease;
}

/* Header bar on mobile */
.mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 99;
}

.menu-hamburger {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.menu-hamburger svg {
    width: 24px;
    height: 24px;
}

/* Cards & Layout Modules */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: var(--card-hover-border);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15), 0 0 15px var(--accent-glow);
}

.glass-card:hover::before {
    opacity: 1;
}

/* Page Titles and Typography */
.page-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1.5rem;
}

.page-title {
    font-size: 2.5rem;
    background: linear-gradient(to right, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

/* Buttons and Links */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
    color: #ffffff;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--card-bg);
    border-color: var(--accent-primary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-success { background-color: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-warning { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-danger { background-color: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-info { background-color: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.2); }

/* File Explorer Simulation (Project 1) */
.file-explorer {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    font-family: Consolas, Monaco, monospace;
    padding: 1.5rem;
    font-size: 0.9rem;
}

.folder-tree {
    list-style: none;
}

.folder-tree li {
    padding: 0.25rem 0;
    display: flex;
    flex-direction: column;
}

.tree-node {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.tree-node:hover {
    background-color: var(--card-bg);
}

.tree-node svg {
    width: 16px;
    height: 16px;
}

.tree-node.folder svg {
    color: #eab308;
    fill: rgba(234, 179, 8, 0.2);
}

.tree-node.file svg {
    color: var(--accent-primary);
}

.tree-children {
    list-style: none;
    margin-left: 1.5rem;
    border-left: 1px dashed var(--card-border);
    padding-left: 0.75rem;
}

/* Interactive Tables (Project 2 & Project 6) */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 2px solid var(--card-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-secondary);
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

/* Filter controls */
.table-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-input, .select-filter {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.search-input:focus, .select-filter:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Side-by-Side tabs (Project 3) */
.tab-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tab-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: var(--card-bg);
}

.tab-btn.active {
    color: #ffffff;
    background: var(--accent-gradient);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* Code Highlights (Project 4) */
pre {
    background: #040817;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1rem 0;
}

code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.code-keyword { color: #f43f5e; font-weight: bold; }
.code-class { color: #38bdf8; }
.code-method { color: #34d399; }
.code-comment { color: #64748b; font-style: italic; }
.code-string { color: #fbbf24; }

/* Image Galleries & Carousels (Project 1, 4 & 5) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 0.5rem;
    transition: transform var(--transition-speed) ease;
}

.gallery-item:hover {
    border-color: var(--accent-primary);
    transform: scale(1.02);
}

.gallery-caption {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    text-align: center;
    font-weight: 500;
}

/* Slideshow style */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid var(--card-border);
    background: var(--bg-secondary);
    aspect-ratio: 16 / 9;
}

.carousel-slide {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(8, 17, 44, 0.85);
    backdrop-filter: var(--glass-blur);
    padding: 1rem 1.5rem;
    color: #ffffff;
    border-top: 1px solid var(--card-border);
}

.carousel-caption h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--accent-primary);
}

.carousel-caption p {
    font-size: 0.85rem;
    color: #cbd5e1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(8, 17, 44, 0.7);
    border: 1px solid var(--card-border);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.carousel-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.carousel-prev { left: 1rem; }
.carousel-next { right: 1rem; }

/* Timeline UI (Project 5) */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin: 1.5rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--card-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.35rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-glow);
    z-index: 2;
}

.timeline-badge {
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Prompt Engineering comparison grids */
.prompt-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.prompt-level-card {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.prompt-level-card.basic { border-left: 4px solid var(--text-muted); }
.prompt-level-card.improved { border-left: 4px solid var(--accent-secondary); }
.prompt-level-card.advanced { border-left: 4px solid var(--accent-primary); }

.prompt-level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 600;
}

.prompt-text {
    font-family: monospace;
    font-size: 0.8rem;
    background: rgba(15, 23, 42, 0.04);
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    white-space: pre-wrap;
    flex: 1;
}

.prompt-response-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--card-border);
    padding-top: 0.75rem;
}

/* Modal lightbox for images */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 10, 25, 0.9);
    backdrop-filter: blur(8px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #ffffff;
    font-size: 2.5rem;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
}

.modal-caption {
    position: absolute;
    bottom: 2rem;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
}

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

/* Responsive Styles */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 2rem 1.5rem;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .prompt-card-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
}

/* About Card Text Highlight (Giới thiệu bản thân) */
.about-card p {
    color: var(--text-primary) !important;
    font-size: 1.05rem;
    line-height: 1.7;
    font-weight: 400;
}
.about-card strong {
    color: var(--accent-primary);
    font-weight: 700;
}
.about-card .section-title {
    color: var(--text-primary);
}

