/* ===================== CSS VARIABLES — LIGHT MODE DEFAULT ===================== */
:root {
    --bg: #f0f4ff;
    --text: #0a0a1a;
    --text-muted: #444466;
    --glass: rgba(0, 0, 0, 0.05);
    --accent: #0055cc;
    --accent2: #6600cc;
    --header-bg: rgba(225, 232, 255, 0.88);
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(0, 80, 200, 0.15);
    --progress-track: #c8d4f0;
    --chat-bg: rgba(240, 244, 255, 0.97);
    --chat-input-bg: #dce6ff;
    --footer-bg: rgba(215, 225, 255, 0.9);
    --footer-text: #334;
    --nav-text: #0a0a2a;
}

/* ===================== DARK MODE VARIABLES ===================== */
body.dark {
    --bg: #000010;
    --text: #e8e8ff;
    --text-muted: #9999bb;
    --glass: rgba(255, 255, 255, 0.05);
    --accent: #00f7ff;
    --accent2: #7b2fff;
    --header-bg: rgba(0, 0, 20, 0.6);
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(0, 247, 255, 0.1);
    --progress-track: #1a1a3e;
    --chat-bg: rgba(10, 10, 30, 0.95);
    --chat-input-bg: #111;
    --footer-bg: rgba(0, 0, 10, 0.8);
    --footer-text: #556;
    --nav-text: #e8e8ff;
}

/* ===================== RESET ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* ===================== BODY ===================== */
body {
    background: transparent;
    color: var(--text);
    transition: color 0.3s;
    min-height: 100vh;
    position: relative;
}

/* Background handled by #galaxy-canvas */

/* ===================== Z-INDEX LAYERING ===================== */
header, section, footer, .hero, #main-content,
nav, #galaxy-canvas, .floating-icons, .chat-button,
.chat-box, #loader, .modal, .cursor-glow {
    position: relative;
    z-index: 1;
}

#galaxy-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

/* ===================== CURSOR GLOW ===================== */
.cursor-glow {
    position: fixed;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: radial-gradient(circle, rgba(0, 85, 200, 0.12), transparent 65%);
}

body.dark .cursor-glow {
    background: radial-gradient(circle, rgba(0, 198, 255, 0.18), transparent 65%);
}

.cursor-glow.visible {
    opacity: 1;
}

/* ===================== HEADER ===================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--card-border);
    z-index: 1000;
    box-sizing: border-box;
    transition: background 0.3s, border-color 0.3s;
}

.logo {
    color: var(--accent);
    font-weight: bold;
    font-size: 20px;
}

nav a {
    margin: 0 15px;
    text-decoration: none;
    color: var(--nav-text);
    transition: color 0.3s;
    font-weight: 500;
}

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

nav a.active {
    border-bottom: 2px solid var(--accent);
    color: var(--accent);
}

#themeToggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* ===================== LOADER ===================== */
#loader {
    position: fixed;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid var(--progress-track);
    border-top: 6px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* ===================== HERO ===================== */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.hero h1 {
    color: var(--text);
    font-size: 2rem;
}

.hero h2 {
    color: var(--accent);
    font-size: 1.2rem;
    margin: 8px 0;
}

.hero p {
    color: var(--text-muted);
}

.hero-buttons {
    margin-top: 20px;
}

.btn-primary,
.btn-outline {
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    margin-right: 10px;
    transition: 0.3s ease;
    font-size: 14px;
    font-weight: 600;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

body.dark .btn-primary {
    color: #000;
}

.btn-primary:hover {
    opacity: 0.8;
}

.btn-outline {
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: #fff;
}

body.dark .btn-outline:hover {
    color: #000;
}

/* ===================== PROFILE ===================== */
.profile-container {
    position: relative;
    display: inline-block;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent);
    box-shadow: 0 0 30px rgba(0, 100, 200, 0.3);
    transition: 0.3s;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(50px);
    animation: fadeUp 1.5s ease forwards;
}

body.dark .profile-img {
    box-shadow: 0 0 30px rgba(0, 198, 255, 0.4);
}

.profile-img:hover {
    transform: scale(1.05);
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.profile-container::before {
    content: "";
    position: absolute;
    top: -5px; left: -5px;
    width: 210px; height: 210px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent), var(--accent2), var(--accent));
    background-size: 300% 300%;
    animation: glowBorder 4s linear infinite;
    z-index: 1;
}

@keyframes glowBorder {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.profile-buttons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
    white-space: nowrap;
    pointer-events: none;
}

.profile-container:hover .profile-buttons {
    opacity: 1;
    pointer-events: all;
}

.upload-btn,
.delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.3s;
}

.upload-btn {
    background: #0072ff;
    color: white;
}

.upload-btn:hover { background: #0055cc; }

.delete-btn {
    background: crimson;
    color: white;
}

.delete-btn:hover { background: darkred; }

.profile-stars-canvas {
    position: absolute;
    top: -5px; left: -5px;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    z-index: 3;
    pointer-events: none;
}

.profile-delete-btn {
    background: crimson;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 16px;
    cursor: pointer;
}

/* ===================== SECTIONS ===================== */
.section {
    padding: 100px 50px;
    opacity: 0;
    transform: translateY(50px);
    transition: 1s ease;
}

.section.show {
    opacity: 1;
    transform: translateY(0);
}

.section h2 {
    color: var(--text);
    margin-bottom: 20px;
    text-align: center;
}

.section p, .section span {
    color: var(--text-muted);
}

/* ===================== ABOUT ===================== */
#about {
    padding: 50px 20px;
    text-align: center;
    margin-top: 0;
    margin-bottom: 80px;
}

#about h2 {
    color: var(--text);
}

#about p {
    max-width: 720px;
    margin: 20px auto;
    line-height: 1.9;
    color: var(--text-muted);
    text-align: justify;
    text-justify: inter-word;
    font-size: 15px;
    letter-spacing: 0.2px;
}

/* ===================== SKILLS ===================== */
#skills {
    padding: 50px 20px;
    margin-top: 120px;
    text-align: center;
}

#skills h2 { color: var(--text); }

#skills span { color: var(--text-muted); font-size: 14px; }

.skill {
    margin: 20px auto;
    max-width: 600px;
}

.progress {
    background: var(--progress-track);
    border-radius: 16px;
    height: 10px;
    overflow: hidden;
    transition: background 0.3s;
}

.progress-bar {
    height: 10px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 16px;
}

/* ===================== EXPERIENCE ===================== */
#experience {
    padding: 80px 20px;
}

#experience h2 {
    display: none;
}

#experience h3 {
    color: var(--text);
}

#experience p,
#experience span {
    color: var(--text-muted);
}

.timeline {
    position: relative;
    max-width: 270px;
    margin: auto;
    padding-left: 30px;
    margin-top: 30px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 15px; top: 0;
    width: 2px;
    height: 100%;
    background: var(--accent);
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 40px;
}

.timeline-dot {
    position: absolute;
    left: 8px; top: 5px;
    width: 14px; height: 14px;
    border: 2px solid var(--accent);
    background: var(--bg);
    cursor: pointer;
    transition: 0.3s;
    border-radius: 3px;
}

.timeline-dot.checked {
    background: var(--accent);
}

/* ===================== SERVICES ===================== */
#services {
    padding: 100px 8%;
}

#services h2 {
    color: var(--text);
    text-align: center;
    margin-bottom: 30px;
}

#services h3 {
    color: var(--text);
    margin-bottom: 10px;
}

#services p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.services-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.service-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 20px;
    border-radius: 10px;
    width: 250px;
    transition: 0.3s;
    backdrop-filter: blur(8px);
}

.service-box:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 100, 200, 0.15);
}

body.dark .service-box:hover {
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.1);
}

/* ===================== PROJECTS ===================== */
#projects,
#cs-projects {
    padding: 80px 8%;
    margin-top: 220px;
}

#projects h2,
#cs-projects h2 {
    color: var(--text);
}

.project-block {
    margin-bottom: 80px;
}

.project-block h2 {
    font-size: 32px;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    color: var(--text);
}

.project-block h2::after {
    content: "";
    display: block;
    width: 60%;
    height: 4px;
    background: linear-gradient(to right, var(--accent), var(--accent2));
    margin-top: 8px;
    border-radius: 5px;
}

/* ===================== ADD IMAGE — DASHED DROP ZONE ===================== */
.project-block label.upload-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 250px;
    height: 250px;
    margin: 20px 0;
    border: 2px dashed var(--accent);
    border-radius: 16px;
    background: transparent;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

/* Inside grid — fixed size matching image wrappers */
.project-block label.upload-btn.grid-uploader {
    width: 300px;
    height: 200px;
    margin: 0;
}

.project-block label.upload-btn::before {
    content: "+";
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
    opacity: 0.9;
    color: var(--accent);
}

.project-block label.upload-btn .label-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

.project-block label.upload-btn .label-sub {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 400;
    color: var(--text-muted);
}

.project-block label.upload-btn:hover {
    background: rgba(0, 100, 200, 0.06);
    transform: scale(1.01);
    box-shadow: 0 0 20px rgba(0, 100, 200, 0.1);
}

body.dark .project-block label.upload-btn:hover {
    background: rgba(0, 247, 255, 0.06);
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.1);
}

/* ===================== PROJECT IMAGE GRID ===================== */
.project-images {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-top: 25px;
}

.image-wrapper {
    position: relative;
    width: 300px;
    height: 200px;
    overflow: hidden;
    border-radius: 15px;
    flex-shrink: 0;
    border: 1px solid var(--card-border);
    background: rgba(0,0,0,0.15);
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
    display: block;
    position: absolute;
    top: 0; left: 0;
}

.image-wrapper .delete-btn {
    position: absolute;
    bottom: 10px; right: 10px;
    background: crimson;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
}

.image-wrapper:hover .delete-btn {
    opacity: 1;
}

/* ===================== GALLERY ===================== */
/* ===================== CS GALLERY — IMAGE UPLOADER ===================== */
#gallery {
    padding: 80px 8%;
    text-align: center;
}

#gallery h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text);
    font-size: 32px;
}

.gallery-upload-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    margin-top: 20px;
}

.gallery-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 510px;
    height: 340px;
    border: 2px dashed var(--accent);
    border-radius: 16px;
    background: transparent;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.2s ease;
}

.gallery-upload-label::before {
    content: "+";
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
    opacity: 0.9;
    color: var(--accent);
}

.gallery-upload-label .label-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

.gallery-upload-label .label-sub {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 400;
    color: var(--text-muted);
}

.gallery-upload-label:hover {
    background: rgba(0, 100, 200, 0.06);
    transform: scale(1.01);
    box-shadow: 0 0 20px rgba(0, 100, 200, 0.1);
}

body.dark .gallery-upload-label:hover {
    background: rgba(0, 247, 255, 0.06);
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.1);
}

.gallery-image-wrapper {
    position: relative;
    width: 510px;
    height: 340px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--card-border);
}

.gallery-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
    display: block;
    position: absolute;
    top: 0; left: 0;
}

.gallery-image-wrapper .delete-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: crimson;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
}

.gallery-image-wrapper:hover .delete-btn {
    opacity: 1;
}

/* ===================== MODAL ===================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 80px;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    text-align: center;
}

.modal img,
.modal-content {
    display: block;
    margin: auto;
    max-width: 80%;
    max-height: 80%;
    border-radius: 15px;
    animation: zoomIn 0.4s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.7); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.close, #closeModal {
    position: absolute;
    top: 30px; right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

/* ===================== FLOATING ICONS — HIDDEN ===================== */
.floating-icons { display: none; }

/* ===================== CHAT ===================== */
.chat-button {
    position: fixed;
    bottom: 20px; right: 20px;
    background: var(--accent);
    color: #fff;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    font-size: 20px;
    transition: background 0.3s;
}

body.dark .chat-button {
    color: #000;
}

.chat-box {
    position: fixed;
    bottom: 80px; right: 20px;
    width: 300px;
    background: var(--chat-bg);
    color: var(--text);
    border-radius: 15px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--card-border);
    z-index: 1000;
    transition: background 0.3s, color 0.3s;
}

.chat-header {
    background: var(--accent);
    color: #fff;
    padding: 10px;
    font-weight: bold;
}

body.dark .chat-header {
    color: #000;
}

.chat-messages {
    padding: 10px;
    height: 200px;
    overflow-y: auto;
    color: var(--text);
}

.chat-box input {
    border: none;
    padding: 10px;
    outline: none;
    background: var(--chat-input-bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
}

/* ===================== CONTENT LAYOUT ===================== */
#main-content {
    padding-top: 160px;
}

.experience-heading {
    text-align: center;
    font-size: 32px;
    color: var(--text);
    margin-bottom: 50px;
    display: block;
    width: 100%;
}

.content-wrapper {
    display: flex;
    gap: 40px;
    max-width: 1200px;
    margin: auto;
}

.left-column  { flex: 2; }
.right-column { flex: 1; }

@media (max-width: 992px) {
    .content-wrapper { flex-direction: column; }
}

/* ===================== FOOTER ===================== */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    background: var(--footer-bg);
    font-size: 14px;
    color: var(--footer-text);
    border-top: 1px solid var(--card-border);
    position: relative;
    z-index: 1;
    transition: background 0.3s, color 0.3s;
}

.social-links { margin-top: 10px; }

.social-links a {
    margin: 0 10px;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
}

/* ===================== GLASS ===================== */
.glass {
    backdrop-filter: blur(15px);
    background: var(--glass);
    border-radius: 16px;
    padding: 40px;
    margin: 40px 0;
}

/* ===================== MISC ===================== */
body.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.skills-list {
    list-style: none;
    padding: 0;
}

.skills-list li {
    display: inline-block;
    margin: 10px;
    padding: 8px 15px;
    background: var(--card-bg);
    border-radius: 16px;
    color: var(--text);
    border: 1px solid var(--card-border);
}

.cert-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.cert-card {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 10px;
    transition: 0.3s;
    border: 1px solid var(--card-border);
}

.cert-card img { width: 100%; border-radius: 10px; }

.project-tabs {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 40px;
}

.project-tabs h3 {
    cursor: pointer;
    font-size: 22px;
    padding-bottom: 5px;
    position: relative;
    color: var(--text);
}

.project-tabs h3::after {
    content: "";
    display: block;
    height: 3px;
    width: 0;
    background: var(--accent);
    transition: 0.3s;
}

.project-tabs h3:hover::after { width: 100%; }

/* ===================== FUNCTIONAL GALLERY ===================== */
#functional-gallery {
    padding: 80px 8%;
    padding-bottom: 160px;
    text-align: center;
}

#functional-gallery h2 {
    font-size: 32px;
    margin-bottom: 40px;
    color: var(--text);
    position: relative;
    display: inline-block;
}

#functional-gallery h2::after {
    content: "";
    display: block;
    width: 60%;
    height: 4px;
    background: linear-gradient(to right, var(--accent), var(--accent2));
    margin: 8px auto 0;
    border-radius: 5px;
}

/* ===================== VIDEO UPLOAD DROP ZONE ===================== */
.video-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 510px;
    height: 340px;
    margin: 0 auto 30px;
    border: 2px dashed var(--accent);
    border-radius: 16px;
    background: transparent;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
    position: relative;
}

/* Inside grid — fixed width so it stays centered when alone */
.video-upload-label.grid-uploader {
    width: 510px;
    height: 340px;
    margin: 0;
}

.video-upload-label::before {
    content: "+";
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
    opacity: 0.9;
    color: var(--accent);
}

.video-upload-label .label-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

.video-upload-label .label-sub {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 400;
    color: var(--text-muted);
}

.video-upload-label:hover {
    background: rgba(0, 100, 200, 0.06);
    transform: scale(1.01);
    box-shadow: 0 0 20px rgba(0, 100, 200, 0.1);
}

body.dark .video-upload-label:hover {
    background: rgba(0, 247, 255, 0.06);
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.1);
}

/* ===================== FUNCTIONAL VIDEO GRID ===================== */
.functional-video-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-top: 10px;
}

.video-wrapper {
    position: relative;
    width: 510px;
    border-radius: 15px;
    overflow: hidden;
    background: transparent;
    border: 1px solid var(--card-border);
}

.video-wrapper video {
    width: 100%;
    border-radius: 15px;
    display: block;
    max-height: 280px;
    object-fit: cover;
}

.video-wrapper .delete-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: crimson;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
}

.video-wrapper:hover .delete-btn {
    opacity: 1;
}

/* ===================== CERTIFICATION — CREATE PROJECT ===================== */
.create-project-btn {
    margin-top: 28px;
    padding: 12px 28px;
    background: transparent;
    border: 2px solid var(--accent);
    border-radius: 25px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
}

.create-project-btn:hover {
    background: rgba(0, 100, 200, 0.08);
    transform: scale(1.03);
    box-shadow: 0 0 18px rgba(0, 100, 200, 0.18);
}

body.dark .create-project-btn:hover {
    background: rgba(0, 247, 255, 0.08);
    box-shadow: 0 0 18px rgba(0, 247, 255, 0.15);
}

/* Modal overlay */
.cp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-modal {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 36px 40px;
    width: 460px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    gap: 20px;
    backdrop-filter: blur(16px);
    box-shadow: 0 0 40px rgba(0, 80, 200, 0.2);
}

body.dark .cp-modal {
    box-shadow: 0 0 40px rgba(0, 200, 255, 0.12);
}

.cp-modal h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.cp-label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.cp-input,
.cp-textarea {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--card-border);
    background: var(--chat-input-bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
}

.cp-input:focus,
.cp-textarea:focus {
    border-color: var(--accent);
}

.cp-textarea {
    height: 80px;
}

.cp-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 4px;
}

.cp-btn-cancel {
    padding: 9px 22px;
    border-radius: 20px;
    border: 1.5px solid var(--card-border);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.cp-btn-cancel:hover { border-color: var(--accent); color: var(--accent); }

.cp-btn-create {
    padding: 9px 26px;
    border-radius: 20px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

body.dark .cp-btn-create { color: #000; }

.cp-btn-create:hover { opacity: 0.85; transform: scale(1.03); }

/* Project cards */
#certProjectsList, #saasProjectsList, #workoutProjectsList {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.cp-card {
    padding: 28px 30px;
    border: 1.5px solid var(--card-border);
    border-radius: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 80, 200, 0.07);
    transition: box-shadow 0.3s;
}

body.dark .cp-card {
    box-shadow: 0 4px 30px rgba(0, 200, 255, 0.06);
}

.cp-card:hover {
    box-shadow: 0 6px 40px rgba(0, 80, 200, 0.13);
}

body.dark .cp-card:hover {
    box-shadow: 0 6px 40px rgba(0, 200, 255, 0.12);
}

.cp-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cp-card-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.cp-card-underline {
    width: 60%;
    height: 4px;
    background: linear-gradient(to right, var(--accent), var(--accent2));
    border-radius: 5px;
}

.cp-delete-card-btn {
    padding: 7px 18px;
    border-radius: 18px;
    border: 1.5px solid crimson;
    background: transparent;
    color: crimson;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    margin-top: 4px;
}

.cp-delete-card-btn:hover { background: crimson; color: #fff; }

.cp-card-desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 22px;
    max-width: 680px;
}

/* Image grid inside project card */
.cp-img-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: flex-start;
    margin-top: 8px;
}

/* Blur page content when modal is open */
body.modal-open > *:not(.cp-modal-overlay):not(#galaxy-canvas) {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.25s ease;
}

body.modal-open .cp-modal-overlay {
    filter: none;
    pointer-events: all;
}

/* ===================== HAMBURGER BUTTON ===================== */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1100;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.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); }

/* ===================== MOBILE — 768px ===================== */
@media (max-width: 768px) {

    /* Header */
    header {
        padding: 12px 20px;
        flex-wrap: wrap;
    }

    .hamburger {
        display: flex;
    }

    nav#mainNav {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0; left: 0;
        width: 100%;
        height: 100vh;
        background: var(--header-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        justify-content: center;
        align-items: center;
        gap: 32px;
        z-index: 1050;
    }

    nav#mainNav.open {
        display: flex;
    }

    nav#mainNav a {
        margin: 0;
        font-size: 20px;
        font-weight: 600;
    }

    /* Hero */
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 100px 24px 60px;
    }

    .hero-content {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .hero h1 { font-size: 1.6rem; }
    .hero h2 { font-size: 1rem; }

    .hero-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .btn-primary, .btn-outline {
        margin: 0;
    }

    /* Profile */
    .profile-img {
        width: 150px;
        height: 150px;
    }

    .profile-container::before {
        width: 160px;
        height: 160px;
    }

    .profile-stars-canvas {
        width: 160px;
        height: 160px;
    }

    /* About */
    #about {
        padding: 40px 20px;
        margin-bottom: 40px;
    }

    #about p {
        font-size: 14px;
    }

    /* Main content */
    #main-content {
        padding-top: 80px;
    }

    .content-wrapper {
        flex-direction: column;
        padding: 0 20px;
    }

    /* Skills */
    #skills {
        padding: 40px 20px;
        margin-top: 40px;
    }

    /* Services */
    #services {
        padding: 40px 20px;
    }

    .services-container {
        flex-direction: column;
        align-items: center;
    }

    .service-box {
        width: 100%;
        max-width: 400px;
    }

    /* CS Projects */
    #projects, #cs-projects {
        padding: 40px 20px;
        margin-top: 40px;
    }

    .project-block h2 {
        font-size: 24px;
    }

    /* Project image grid — fluid */
    .project-images {
        gap: 16px;
    }

    .image-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 2;
    }

    .project-block label.upload-btn.grid-uploader {
        width: 100%;
        height: 160px;
    }

    /* Gallery */
    #gallery {
        padding: 40px 20px;
    }

    .gallery-upload-grid {
        gap: 16px;
    }

    .gallery-upload-label,
    .gallery-upload-label.grid-uploader {
        width: 100%;
        height: 240px;
    }

    .gallery-image-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 2;
    }

    /* Functional Gallery */
    #functional-gallery {
        padding: 40px 20px 80px;
    }

    .video-upload-label,
    .video-upload-label.grid-uploader {
        width: 100%;
        height: 240px;
    }

    .functional-video-grid {
        gap: 16px;
    }

    .video-wrapper {
        width: 100%;
    }

    /* Chat */
    .chat-box {
        width: calc(100vw - 40px);
        right: 20px;
        bottom: 80px;
    }

    /* Experience timeline */
    .timeline {
        max-width: 100%;
    }

    /* Footer */
    footer {
        padding: 20px 16px;
    }

    .social-links a {
        margin: 0 6px;
    }

    /* Modal */
    .cp-modal {
        padding: 24px 20px;
        width: 92vw;
    }
}

/* ===================== MOBILE — 480px ===================== */
@media (max-width: 480px) {

    .hero h1 { font-size: 1.35rem; }
    .hero h2 { font-size: 0.95rem; }

    .profile-img {
        width: 120px;
        height: 120px;
    }

    .profile-container::before {
        width: 130px;
        height: 130px;
    }

    .profile-stars-canvas {
        width: 130px;
        height: 130px;
    }

    .btn-primary, .btn-outline {
        padding: 9px 16px;
        font-size: 13px;
    }

    .project-block h2 { font-size: 20px; }

    #gallery h2,
    #functional-gallery h2 { font-size: 24px; }

    .experience-heading { font-size: 24px; }
}
