/* =======================================================
   1. CSS VARIABLES (DARK & LIGHT MODE)
   ======================================================= */
:root {
    /* Base Colors (Electric Indigo) */
    --hue: 250;
    --primary-color: hsl(var(--hue), 80%, 65%);
    --primary-color-hover: hsl(var(--hue), 80%, 55%);
    --gradient-1: linear-gradient(135deg, hsl(250, 80%, 65%), hsl(290, 80%, 65%));
    
    /* Default Dark Theme */
    --bg-main: #0a0a0c;
    --bg-secondary: #141418;
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(10, 10, 12, 0.7);
    
    /* Utilities */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
}

[data-theme="light"] {
    --bg-main: #ffffff;
    --bg-secondary: #f3f4f6;
    --text-main: #111827;
    --text-muted: #4b5563;
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
}

/* =======================================================
   2. RESET & BASE SETUP
   ======================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Standard system cursor everywhere, with clear affordance on interactive elements */
a, button, .btn, .hamburger, .nav-login-btn, #theme-toggle,
input[type="submit"], input[type="checkbox"], .close-modal,
.btn-edit, .btn-delete, .nav-link, label[for] {
    cursor: pointer;
}

input, textarea, select {
    cursor: text;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 100px 0;
}

/* =======================================================
   3. UI ELEMENTS (Loader, Scroll Progress)
   ======================================================= */
.loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-main);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loader-spinner {
    width: 50px; height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.scroll-progress-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 3px;
    background: transparent;
    z-index: 1000;
}

.scroll-progress-bar {
    height: 100%;
    background: var(--gradient-1);
    width: 0%;
}

/* =======================================================
   4. NAVIGATION BAR (Glassmorphism)
   ======================================================= */
.header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px); 
    border-bottom: 1px solid var(--border-color);
    z-index: 900;
    transition: var(--transition);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#theme-toggle, #nav-login-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
}

.hamburger .bar {
    width: 25px; height: 3px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* =======================================================
   5. BUTTONS & HERO SECTION
   ======================================================= */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--gradient-1);
    color: #fff;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.5);
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--text-main);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px; 
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content .greeting {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 1rem;
}

.hero-name {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: var(--text-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.typing-cursor {
    animation: blink 0.8s infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
}

.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}

.image-blob {
    width: 400px;
    height: 400px;
    background: var(--gradient-1);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morph 8s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.2);
}

.image-blob img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes morph {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

/* =======================================================
   6. GLOBAL SECTION TITLES
   ======================================================= */
.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title span {
    color: var(--primary-color);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gradient-1);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* =======================================================
   7. ABOUT SECTION
   ======================================================= */
.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.about-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.stat-box {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    min-width: 150px;
}

.stat-box:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.1);
}

.stat-num {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* =======================================================
   8. SKILLS SECTION
   ======================================================= */
.glass-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.skill-card {
    background: var(--bg-main);
    padding: 2rem 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: center;
}

.skill-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(108, 92, 231, 0.15);
}

.skill-icon-badge {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary-color);
    font-size: 1.8rem;
    transition: var(--transition);
}

.skill-card:hover .skill-icon-badge {
    background: var(--gradient-1);
    color: #fff;
    transform: scale(1.1) rotate(-8deg);
}

.skill-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.skill-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.7rem;
}

.skill-bar-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 4px;
}

.skill-percentage {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* =======================================================
   9. LOGIN MODAL
   ======================================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: var(--bg-main);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 400px;
    transform: translateY(50px) scale(0.95);
    transition: transform 0.4s ease;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
}

.close-modal {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.close-modal:hover { color: var(--primary-color); }

.modal-box h2 {
    text-align: center; margin-bottom: 2rem; color: var(--text-main);
}

.input-group {
    position: relative; margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%; padding: 12px 15px 12px 45px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 8px; color: var(--text-main); font-family: 'Inter', sans-serif;
    outline: none; transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.login-error {
    background: rgba(220, 38, 38, 0.1); color: #ef4444; border: 1px solid rgba(220, 38, 38, 0.3);
    padding: 10px; border-radius: 6px; margin-bottom: 1rem; text-align: center; font-size: 0.9rem;
}

.success-msg {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

/* =======================================================
   10. SERVICES SECTION
   ======================================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-main);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.15);
}

.service-icon {
    width: 70px; height: 70px;
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary-color);
    font-size: 2rem;
    display: flex; justify-content: center; align-items: center;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: var(--gradient-1);
    color: #fff;
    transform: rotateY(360deg);
}

.service-card h3 {
    font-size: 1.2rem; margin-bottom: 1rem; color: var(--text-main);
}

.service-card p {
    color: var(--text-muted); font-size: 0.95rem;
}

/* =======================================================
   11. PROJECTS SECTION
   ======================================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(108, 92, 231, 0.15);
}

.project-card-img-wrap {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.project-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-card-img-wrap img {
    transform: scale(1.08);
}

.project-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-card-body h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
    color: var(--text-main);
}

.project-card-body p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-card-footer {
    margin-top: auto;
}

.project-tech-tag {
    color: var(--primary-color);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-card-actions {
    display: flex;
    gap: 10px;
}

.project-card-actions .btn {
    padding: 10px 18px;
    font-size: 0.85rem;
    flex: 1;
    text-align: center;
}

.projects-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: var(--text-muted);
}

.projects-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* =======================================================
   12. CONTACT SECTION
   ======================================================= */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.info-item p a:hover {
    color: var(--primary-color);
}

.contact-info h3 {
    font-size: 1.8rem; margin-bottom: 1rem; color: var(--text-main);
}

.contact-info > p {
    color: var(--text-muted); margin-bottom: 2.5rem;
}

.info-item {
    display: flex; gap: 1.5rem; margin-bottom: 2rem; align-items: flex-start;
}

.info-icon {
    width: 50px; height: 50px;
    background: rgba(108, 92, 231, 0.1); color: var(--primary-color);
    display: flex; justify-content: center; align-items: center;
    border-radius: 50%; font-size: 1.2rem;
    flex-shrink: 0;
}

.info-item h4 {
    font-size: 1.1rem; color: var(--text-main); margin-bottom: 0.3rem;
}

.info-item p {
    color: var(--text-muted); font-size: 0.95rem;
}

.contact-form-wrapper {
    background: var(--bg-main); padding: 2.5rem;
    border-radius: var(--border-radius); border: 1px solid var(--border-color);
}

.form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}

.form-group { margin-bottom: 1.5rem; }

.form-group input, .form-group textarea {
    width: 100%; padding: 15px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 8px; color: var(--text-main); font-family: 'Inter', sans-serif;
    outline: none; transition: var(--transition); resize: vertical;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

/* =======================================================
   13. FOOTER & BACK TO TOP
   ======================================================= */
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* =======================================================
   14. RESPONSIVE
   ======================================================= */
@media (max-width: 900px) {
    .hero-container, .contact-container { grid-template-columns: 1fr; gap: 2rem; }
    .hero-name { font-size: 3rem; }
    .form-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .hamburger { display: flex; }
}

@media (max-width: 600px) {
    .hero-name { font-size: 2.4rem; }
    .hero-title { font-size: 1.4rem; }
    .hero-cta { flex-direction: column; gap: 1rem; }
    .image-blob { width: 280px; height: 280px; }
    .about-stats { gap: 1.5rem; }
    .contact-container { padding: 1.5rem; }
    .section-title { font-size: 2rem; }
}
.skill-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-main);
}