/* ============================================================
   CODECX PORTFOLIO — Enhanced Dark UI
   ============================================================ */

/* --- RESET & BASE --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg:         #080d17;
    --bg-alt:     #0d1526;
    --surface:    #111c30;
    --surface-2:  #162038;
    --border:     rgba(59,130,246,0.15);
    --border-mid: rgba(99,155,255,0.25);
    --blue:       #3b82f6;
    --blue-hover: #60a5fa;
    --blue-dim:   rgba(59,130,246,0.12);
    --text:       #e8f0fe;
    --text-muted: #7a90b8;
    --text-dim:   #4a5e80;
    --green:      #22c55e;
    --android:    #3ddc84;
    --ios:        #a78bfa;
    --radius:     14px;
    --radius-sm:  8px;
    --shadow:     0 8px 32px rgba(0,0,0,0.4);
    --transition: 0.25s ease;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.2;
}

a { text-decoration: none; }
img { display: block; max-width: 100%; }

/* --- UTILITY --- */
.container {
    width: 90%;
    max-width: 1140px;
    margin: 0 auto;
}
.section { padding: 90px 0; }
.bg-alt { background: var(--bg-alt); }
.text-center { text-align: center; }

/* --- GRADIENT TEXT --- */
.gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 60%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
}
.btn-primary {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 4px 20px rgba(59,130,246,0.35);
}
.btn-primary:hover {
    background: var(--blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(59,130,246,0.5);
}
.btn-outline {
    background: transparent;
    color: var(--blue);
    border: 1.5px solid var(--border-mid);
}
.btn-outline:hover {
    background: var(--blue-dim);
    border-color: var(--blue);
    transform: translateY(-2px);
    color: var(--blue-hover);
}

/* --- NAVBAR --- */
.navbar {
    background: rgba(8, 13, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 200;
    height: 68px;
    display: flex;
    align-items: center;
    transition: background var(--transition);
}
.navbar.scrolled {
    background: rgba(8, 13, 23, 0.97);
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.logo {
        display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--blue);
    letter-spacing: 0.05em;
    text-shadow: 0 0 30px rgba(59,130,246,0.5);
}
.nav-links {
    list-style: none;
    display: flex;
    gap: 6px;
}
.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 6px;
    transition: all var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: var(--blue-dim);
}
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- SECTION HEADER --- */
.section-header {
    text-align: center;
    margin-bottom: 56px;
}
.section-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--blue);
    background: var(--blue-dim);
    border: 1px solid var(--border-mid);
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
}
.section-title {
    font-size: 2.2rem;
    color: var(--text);
    font-weight: 700;
}

/* --- HERO --- */
.hero {
    position: relative;
    min-height: 88vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(59,130,246,0.12) 0%, transparent 70%),
                var(--bg);
}
.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(59,130,246,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}
.hero-container {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 80px 0;
    position: relative;
    z-index: 1;
}
.hero-content { flex: 1; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--green);
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.25);
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 28px;
    letter-spacing: 0.04em;
}
.hero-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}
.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    line-height: 1.15;
    margin-bottom: 22px;
    font-weight: 700;
}
.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 36px;
    line-height: 1.7;
}
.hero-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}
.hero-platforms {
    display: flex;
    gap: 10px;
}
.platform-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}
.platform-badge.android {
    background: rgba(61,220,132,0.1);
    color: var(--android);
    border: 1px solid rgba(61,220,132,0.2);
}
.platform-badge.ios {
    background: rgba(167,139,250,0.1);
    color: var(--ios);
    border: 1px solid rgba(167,139,250,0.2);
}
.platform-badge.kmp {
    background: rgba(59,130,246,0.1);
    color: var(--blue-hover);
    border: 1px solid var(--border-mid);
}
.hero-visual {
    flex: 0 0 auto;
    position: relative;
    display: flex;
    justify-content: center;
}
.hero-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59,130,246,0.2) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    pointer-events: none;
    border-radius: 50%;
}
.phone-mockup {
    width: 200px;
    height: 400px;
    background: linear-gradient(160deg, #1a2744 0%, #0d1526 100%);
    border-radius: 36px;
    border: 2px solid rgba(59,130,246,0.3);
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05) inset;
    padding: 16px;
    position: relative;
    animation: float 4s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.phone-notch {
    width: 60px;
    height: 20px;
    background: var(--bg);
    border-radius: 0 0 12px 12px;
    margin: 0 auto 16px;
}
.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 8px;
}
.app-icon {
    height: 44px;
    border-radius: 10px;
    animation: shimmer 3s ease-in-out infinite;
}
.app-icon.a1 { background: linear-gradient(135deg, #3b82f6, #1d4ed8); animation-delay: 0s; }
.app-icon.a2 { background: linear-gradient(135deg, #22c55e, #15803d); animation-delay: 0.3s; }
.app-icon.a3 { background: linear-gradient(135deg, #a78bfa, #7c3aed); animation-delay: 0.6s; }
.app-icon.a4 { background: linear-gradient(135deg, #f59e0b, #d97706); animation-delay: 0.9s; }
.app-icon.a5 { background: linear-gradient(135deg, #ec4899, #be185d); animation-delay: 1.2s; }
.app-icon.a6 { background: linear-gradient(135deg, #06b6d4, #0891b2); animation-delay: 1.5s; }
@keyframes shimmer {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* --- ABOUT --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.about-text {
    font-size: 1.08rem;
    color: var(--text-muted);
    line-height: 1.8;
}
.about-text em { color: var(--text); font-style: normal; font-weight: 600; }
.about-highlights {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--surface);
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}
.highlight-item:hover { border-color: var(--border-mid); }
.highlight-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
    margin-top: 2px;
}
.highlight-item strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 4px;
    font-family: 'Space Grotesk', sans-serif;
}
.highlight-item p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* --- STATS --- */
.stats-section {
    padding: 70px 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.stat-card {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}
.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-mid);
    box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}
.stat-card h3 {
    font-size: 2.8rem;
    color: var(--blue);
    margin-bottom: 8px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
}
.stat-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* --- TECH STACK --- */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}
.skill-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.92rem;
    border: 1px solid var(--border);
    transition: all var(--transition);
    color: var(--text);
}
.skill-card:hover {
    transform: translateY(-4px);
    border-color: var(--blue);
    background: var(--surface-2);
    box-shadow: 0 8px 24px rgba(59,130,246,0.15);
}
.skill-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
/* --- TABS --- */
.tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 44px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.tab-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 8px 8px 0 0;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
    position: relative;
    bottom: -1px;
    border-bottom: 2px solid transparent;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

/* --- PROJECT CATEGORY --- */
.project-category {
    margin-bottom: 60px;
    transition: opacity 0.3s, transform 0.3s;
}
.project-category.hidden {
    display: none;
}
.category-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 28px;
    padding-left: 4px;
}
.category-label svg { opacity: 0.7; }

/* --- PROJECT GRID & CARDS --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.project-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}
.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-mid);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.project-card-thumb {
    width: 100%;
    height: 190px;
    object-fit: cover;
    transition: transform 0.4s ease;
    background: var(--surface-2);
}
.project-card:hover .project-card-thumb {
    transform: scale(1.04);
}
.project-card-thumb-wrap {
    overflow: hidden;
    position: relative;
    height: 190px;
}
.project-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(8,13,23,0.85) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition);
    display: flex;
    align-items: flex-end;
    padding: 18px;
}
.project-card:hover .project-card-overlay { opacity: 1; }
.project-card-cta {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: var(--blue);
    padding: 7px 16px;
    border-radius: 6px;
    letter-spacing: 0.04em;
}
.project-info {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.project-info h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.project-info p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 16px;
    flex: 1;
    line-height: 1.6;
}
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tags span {
    background: var(--blue-dim);
    color: var(--blue-hover);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-mid);
}

/* --- FOOTER --- */
.footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 90px 0 50px;
    position: relative;
    overflow: hidden;
    text-align: center;
}
.footer-glow {
    position: absolute;
    width: 500px;
    height: 300px;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}
.footer-title {
    font-size: 2rem;
    margin-bottom: 14px;
    margin-top: 12px;
}
.footer-sub {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 36px;
}
.contact-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}
.copyright {
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 18, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.modal {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 20px;
    width: 100%;
    max-width: 980px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
    opacity: 0;
    box-shadow: 0 40px 120px rgba(0,0,0,0.7);
}
.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all var(--transition);
    z-index: 10;
}
.modal-close:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.4);
    color: #ef4444;
}
.modal-body {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    min-height: 500px;
}

/* Modal Media panel */
.modal-media {
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.modal-video-wrap {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
}
.modal-video-wrap video {
    width: 100%;
    display: block;
    border-radius: var(--radius-sm);
}
.modal-screenshots {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--bg-alt);
    min-height: 300px;
}
.modal-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    transition: opacity 0.3s;
    max-height: 400px;
    object-position: top;
}
.no-media-msg {
    color: var(--text-dim);
    font-size: 0.875rem;
    text-align: center;
    padding: 40px;
}
.screenshot-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.thumb-btn {
    background: none;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    transition: border-color var(--transition);
}
.thumb-btn:hover,
.thumb-btn.active {
    border-color: var(--blue);
}
.thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* Modal Info panel */
.modal-info {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.modal-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 13px;
    border-radius: 20px;
    align-self: flex-start;
}
.modal-platform-badge.android-badge {
    background: rgba(61,220,132,0.1);
    color: var(--android);
    border: 1px solid rgba(61,220,132,0.25);
}
.modal-platform-badge.ios-badge {
    background: rgba(167,139,250,0.1);
    color: var(--ios);
    border: 1px solid rgba(167,139,250,0.25);
}
.modal-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
}
.modal-year {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: -8px;
}
.modal-description {
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.75;
    flex: 1;
}
.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.modal-cta {
    align-self: flex-start;
    margin-top: 8px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .stats-container { grid-template-columns: repeat(2, 1fr); }
    .about-grid { grid-template-columns: 1fr; gap: 36px; }
    .modal-body { grid-template-columns: 1fr; }
    .modal-media { border-right: none; border-bottom: 1px solid var(--border); }
    .modal { max-height: 95vh; }
    .hero-visual { display: none; }
}

@media (max-width: 768px) {
    .navbar { height: 60px; }
    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(8,13,23,0.97);
        border-bottom: 1px solid var(--border);
        padding: 20px;
        flex-direction: column;
        gap: 4px;
        transform: translateY(-200%);
        transition: transform 0.3s ease;
        z-index: 199;
    }
    .nav-links.open { transform: translateY(0); }
    .nav-links a {
        display: block;
        padding: 12px 16px;
        font-size: 1rem;
    }
    .hamburger { display: flex; }
    .hero-container { padding: 60px 0; }
    .hero-title { font-size: 2rem; }
    .hero-sub { font-size: 0.97rem; }
    .section { padding: 60px 0; }
    .section-title { font-size: 1.8rem; }
    .stats-container { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .stat-card h3 { font-size: 2.2rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .contact-links { flex-direction: column; align-items: center; }
    .modal-info { padding: 24px 20px; }
    .modal-media { padding: 20px; }
}

@media (max-width: 480px) {
    .hero-buttons { flex-direction: column; align-items: flex-start; }
    .btn { width: auto; }
}

/* --- SCROLL REVEAL --- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
