/* ========================================
   M6 Graduate - Premium White Theme
   Hacker/Tech Style
   ======================================== */

/* === CSS Variables === */
:root {
    /* White Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;

    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;

    /* Accent Colors */
    --accent-primary: #000000;
    --accent-secondary: #495057;
    --accent-success: #28a745;
    --accent-warning: #ffc107;

    /* Border & Shadows */
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

    /* Typography */
    --font-mono: 'Space Mono', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden {
    display: none !important;
}

/* === Loading Screen === */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.terminal {
    width: 100%;
    max-width: 600px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-color);
    overflow: hidden;
    animation: terminalSlideUp 0.6s ease-out;
}

@keyframes terminalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.terminal-header {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
}

.header-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
}

.btn-close {
    background: #ff5f56;
}

.btn-minimize {
    background: #ffbd2e;
}

.btn-maximize {
    background: #27c93f;
}

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.terminal-body {
    padding: 2rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.8;
}

.terminal-line {
    margin-bottom: 0.75rem;
    opacity: 0;
    animation: fadeInLine 0.4s ease-out forwards;
}

.terminal-line.delay-1 {
    animation-delay: 0.3s;
}

.terminal-line.delay-2 {
    animation-delay: 0.6s;
}

.terminal-line.delay-3 {
    animation-delay: 1.2s;
}

.terminal-line.delay-4 {
    animation-delay: 1.8s;
}

.terminal-line.delay-5 {
    animation-delay: 2.4s;
}

.terminal-line.delay-6 {
    animation-delay: 3s;
}

@keyframes fadeInLine {
    to {
        opacity: 1;
    }
}

.prompt {
    color: var(--accent-primary);
    font-weight: 700;
    margin-right: 0.5rem;
}

.command {
    color: var(--text-primary);
}

.output {
    color: var(--text-secondary);
    display: inline-block;
}

.output.success {
    color: var(--accent-success);
    font-weight: 600;
}

.output.welcome {
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.loading-dots {
    display: inline-block;
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

.progress-bar {
    display: inline-block;
    width: 200px;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-left: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    vertical-align: middle;
}

.progress-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    width: 0%;
    animation: progressFill 1.2s ease-out forwards;
}

@keyframes progressFill {
    to {
        width: 100%;
    }
}

.start-button {
    margin-top: 1.5rem;
    padding: 1.125rem 3rem;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    background-size: 200% 100%;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.2),
        0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.start-button:hover::before {
    left: 100%;
}

.start-button:hover {
    background-position: 100% 0;
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.25),
        0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.button-text {
    position: relative;
    z-index: 1;
    text-transform: uppercase;
}

.start-button:active {
    transform: translateY(0);
}

/* === Main Content === */
.main-content {
    opacity: 0;
    animation: fadeInContent 0.8s ease-out forwards;
}

@keyframes fadeInContent {
    to {
        opacity: 1;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === Hero Section === */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    pointer-events: none;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 2rem;
}

.glitch-wrapper {
    position: relative;
    display: inline-block;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
    font-family: var(--font-mono);
    position: relative;
    margin-bottom: 1rem;
    animation: glitchText 3s infinite;
}

@keyframes glitchText {

    0%,
    90%,
    100% {
        transform: translate(0);
    }

    92% {
        transform: translate(-2px, 2px);
    }

    94% {
        transform: translate(2px, -2px);
    }

    96% {
        transform: translate(-2px, -2px);
    }

    98% {
        transform: translate(2px, 2px);
    }
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-divider {
    width: 100px;
    height: 3px;
    background: var(--accent-primary);
    margin: 0 auto;
    border-radius: 2px;
}

.hero-signature {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-style: italic;
    letter-spacing: 0.02em;
}

/* === Section Styles === */
section {
    padding: var(--spacing-xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

/* === Video Section (YouTube Shorts) === */
.video-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.video-container {
    max-width: 360px;
    margin: 0 auto;
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 14px;
}

/* === Gallery Section === */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    color: var(--text-muted);
    position: relative;
}

.placeholder-icon-small {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 1rem;
}

.image-number {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.gallery-note {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.gallery-note p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* === YouTube Section === */
.youtube-section {
    padding: var(--spacing-lg) 0;
    background: var(--bg-primary);
}

.youtube-cta {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.youtube-text {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.youtube-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #c24949;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.youtube-btn:hover {
    background: #CC0000;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.4);
}

.youtube-btn:active {
    transform: translateY(0);
}

/* === Footer === */
.footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    padding: var(--spacing-md) 0;
}

.footer-content {
    text-align: center;
}

.footer-text {
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.code-tag {
    color: var(--accent-primary);
    font-weight: 700;
}

.footer-year {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* === Modal === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-color);
}

.modal-close {
    position: absolute;
    top: -1rem;
    right: -1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    border: 2px solid var(--bg-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.modal-close:hover {
    transform: scale(1.1);
    background: var(--accent-secondary);
}

#modal-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    display: block;
}

.modal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    gap: 1rem;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.nav-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.image-counter {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* === Responsive === */
@media (max-width: 768px) {
    .terminal-body {
        padding: 1.5rem;
        font-size: 0.8rem;
    }

    .progress-bar {
        width: 150px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .modal-nav {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .terminal {
        border-radius: 8px;
    }

    .terminal-body {
        padding: 1rem;
        font-size: 0.75rem;
    }

    .start-button {
        width: 100%;
        justify-content: center;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* === Custom Scrollbar === */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}