/* --- CSS VARIABLES --- */
:root {
    /* Colors */
    --bg-color: #0f172a; /* Dark Slate Blue */
    --second-bg-color: #1e293b; 
    --text-color: #f1f5f9;
    --main-color: #0ea5e9; /* Cyan / Blue accent */
    --neon-glow: 0 0 15px rgba(14, 165, 233, 0.4);
    --card-bg: rgba(30, 41, 59, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);

    --font-main: 'Outfit', sans-serif;
    
    /* Layout */
    --section-padding: 10rem 9% 2rem;
}

/* Light Mode Variables override */
.light-mode {
    --bg-color: #f8fafc;
    --second-bg-color: #ffffff;
    --text-color: #0f172a;
    --main-color: #0284c7;
    --neon-glow: 0 0 15px rgba(2, 132, 199, 0.2);
    --card-bg: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.1);
}

/* --- RESET & BASICS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: var(--font-main);
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
    background-image: radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.05), transparent 40%),
                      radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.05), transparent 40%);
}

::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--main-color);
    border-radius: 10px;
}

/* --- PRELOADER --- */
#preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color);
    background-image: radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.05), transparent 40%),
                      radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.05), transparent 40%);
    z-index: 9999;
    display: flex;
    justify-content: center; align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loader-circle {
    width: 60px; height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--main-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: var(--neon-glow);
}

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

/* --- HEADER --- */
header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 2rem 9%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: .3s;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
}

header.sticky {
    padding: 1.5rem 9%;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-color);
}
.logo span {
    color: var(--main-color);
    text-shadow: var(--neon-glow);
}

.navbar { display: flex; align-items: center; }

.navbar a {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 500;
    margin-left: 2.5rem;
    transition: .3s;
}

.navbar a:hover,
.navbar a.active {
    color: var(--main-color);
    text-shadow: var(--neon-glow);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#menu-icon {
    font-size: 2.5rem;
    color: var(--text-color);
    display: none;
    cursor: pointer;
}

.theme-toggle {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    transition: .3s;
}
.theme-toggle:hover {
    color: var(--main-color);
}

/* --- BTN CLASS --- */
.btn {
    display: inline-block;
    padding: 0.8rem 2.2rem;
    background: var(--main-color);
    border-radius: 8px;
    box-shadow: var(--neon-glow);
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
    transition: .3s;
    cursor: pointer;
    border: 1px solid var(--main-color);
}

.btn:hover {
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.7);
    transform: translateY(-3px);
}

.btn-secondary {
    background: transparent;
    color: var(--main-color);
    box-shadow: none;
}
.btn-secondary:hover {
    background: var(--main-color);
    color: #fff;
}
.btn-small { padding: 0.5rem 1.2rem; font-size: 0.9rem; }

/* --- HOME HERO --- */
.home {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: var(--section-padding);
}

.home-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('assets/images/hero_bg.png') no-repeat center center/cover;
    filter: blur(5px) brightness(0.4);
    transition: filter 0.3s ease, opacity 0.3s ease;
    z-index: 0;
}
.light-mode .home-bg {
    filter: blur(5px) brightness(1.2) opacity(0.2);
}

.home-content {
    max-width: 650px;
    z-index: 1;
}
.z-index-1 { position: relative; z-index: 1; }

.home-content h3 {
    font-size: 2.5rem;
    font-weight: 700;
}

.home-content h1 {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.3;
    background: -webkit-linear-gradient(45deg, var(--text-color), var(--main-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 10px;
}

.home-content .typing-text {
    color: var(--main-color);
    border-right: 2px solid var(--main-color);
    padding-right: 5px;
    animation: blinkCursor 0.7s infinite;
}

@keyframes blinkCursor {
    50% { border-right-color: transparent; }
}

.small-line {
    font-size: 1.2rem;
    margin: 1.5rem 0 2rem;
    color: #94a3b8;
}

.social-media a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px; height: 45px;
    background: transparent;
    border: 2px solid var(--main-color);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--main-color);
    margin-right: 1.2rem;
    margin-bottom: 2rem;
    transition: .3s;
}
.social-media a:hover {
    background: var(--main-color);
    color: #fff;
    box-shadow: var(--neon-glow);
    transform: translateY(-3px);
}

.btn-group { display: flex; gap: 1.5rem; }

/* --- COMMON HEADING --- */
section { padding: var(--section-padding); }

.heading {
    text-align: center;
    font-size: 3.5rem;
    margin-bottom: 3rem;
}
.heading span {
    color: var(--main-color);
    text-shadow: var(--neon-glow);
}
.sub-heading { text-align: center; color: #94a3b8; font-size: 1.5rem; margin-top: -2.5rem; margin-bottom: 3rem; font-weight: 400; }

/* --- REVEAL ANIMATION (SCROLL) --- */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- ABOUT SECTION --- */
.about {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: var(--second-bg-color);
}
.about-content {
    display: flex;
    align-items: center;
    gap: 5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.about-img {
    position: relative;
    width: 35vw;
    display: flex;
    justify-content: center;
}

.about-img img {
    width: 100%;
    border-radius: 20px;
    z-index: 1;
    object-fit: cover;
    aspect-ratio: 1/1;
}

.about-img .glow-effect {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; height: 100%;
    background: var(--main-color);
    filter: blur(80px);
    opacity: 0.15;
    z-index: 0;
}

.about-text {
    flex: 1;
}
.about-text.text-center {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}
.about-text h3 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
}
.about-text p {
    font-size: 1.1rem;
    color: #94a3b8;
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* --- SERVICES --- */
.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.services-box {
    background: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: .4s ease;
}

.services-box:hover {
    transform: translateY(-10px);
    border-color: var(--main-color);
    box-shadow: var(--neon-glow);
}

.services-box i {
    font-size: 4rem;
    color: var(--main-color);
    margin-bottom: 1.5rem;
}
.services-box h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}
.services-box p {
    font-size: 1.1rem;
    color: #94a3b8;
    line-height: 1.6;
}

/* --- SKILLS --- */
.skills { background: var(--second-bg-color); }

.skills-container {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.skill-group {
    flex: 1;
}

.skill-group h3 {
    font-size: 2rem;
    margin-bottom: 2.5rem;
}

.skill-box { margin-bottom: 2rem; }

.skill-box .title {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.skill-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.skill-per {
    position: absolute;
    left: 0; top: 0; height: 100%;
    background: var(--main-color);
    border-radius: 10px;
    transition: width 1.5s ease-out;
    box-shadow: var(--neon-glow);
}

.tooltip {
    position: absolute;
    right: -15px; top: -30px;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--main-color);
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
    opacity: 0;
    transition: 0.3s;
}
.skill-per.animated .tooltip { opacity: 1; }

.skill-box:hover .skill-per {
    filter: brightness(1.2);
}

/* --- PROJECTS --- */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    max-width: 1200px; margin: 0 auto;
}

.project-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2.5rem 2rem;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: 0.4s;
    display: flex; flex-direction: column;
    justify-content: flex-start;
}
.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--neon-glow);
    border-color: var(--main-color);
}

.project-content h3 { font-size: 1.8rem; margin-bottom: 1rem; color: #fff;}
.light-mode .project-content h3 { color: var(--text-color); }

.project-content p { color: #94a3b8; font-size: 1.1rem; margin-bottom: 1.5rem; line-height: 1.6;}

.tech-stack {
    display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.tech-stack span {
    background: rgba(14, 165, 233, 0.1);
    color: var(--main-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.project-links {
    margin-top: auto; display: flex; gap: 1rem;
}

/* --- CYBER SEC --- */
.cybersec { background: var(--second-bg-color); }

.cyber-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 3rem 4rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.cyber-list {
    list-style: none;
}
.cyber-list li {
    font-size: 1.2rem;
    margin-bottom: 1.8rem;
    display: flex; align-items: center; gap: 1rem;
    color: #e2e8f0;
}
.light-mode .cyber-list li { color: var(--text-color); }
.cyber-list li i {
    font-size: 1.8rem;
    color: var(--main-color);
}
.cyber-list li:last-child { margin-bottom: 0; }

/* --- EXPERIENCE TIMELINE --- */
.experience { position: relative; }

.timeline {
    position: relative; max-width: 800px; margin: 0 auto;
}
.timeline::after {
    content: ''; position: absolute; width: 2px; background: var(--main-color);
    top: 0; bottom: 0; left: 50%; margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px; position: relative;
    background: inherit; width: 50%;
}
.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }

.timeline-dot {
    position: absolute; width: 16px; height: 16px; right: -8px;
    background: var(--main-color); border: 4px solid var(--bg-color);
    border-radius: 50%; top: 15px; z-index: 1;
    box-shadow: var(--neon-glow);
}
.timeline-item:nth-child(even) .timeline-dot { left: -8px; }

.timeline-content {
    padding: 20px 30px;
    background: var(--card-bg);
    position: relative; border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.timeline-date { color: var(--main-color); font-weight: 600; display: block; margin-bottom: 10px; }
.timeline-content h4 { font-size: 1.4rem; margin-bottom: 10px; }
.timeline-content p { color: #94a3b8; font-size: 1rem; line-height: 1.6;}

/* --- CONTACT --- */
.contact { background: var(--second-bg-color); }
.contact-container {
    max-width: 800px; margin: 0 auto;
}
.contact form {
    background: var(--card-bg);
    padding: 3rem; border-radius: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.input-box {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem;
}
.input-box input { width: calc(50% - 0.75rem); }

.contact form input, .contact form textarea {
    width: 100%; padding: 1.2rem; font-size: 1.1rem;
    background: var(--bg-color); color: var(--text-color);
    border-radius: 8px; margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: 0.3s;
}
.contact form textarea { resize: none; height: 180px; }

.contact form input:focus, .contact form textarea:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
}
#form-status { margin-top: 15px; font-weight: 600; }

/* --- FOOTER --- */
.footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 2rem 9%; background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}
.footer-text p { font-size: 1.1rem; color: #94a3b8; }
.footer-iconTop a {
    display: inline-flex; justify-content: center; align-items: center;
    padding: .8rem; background: var(--main-color); border-radius: 8px;
    transition: .3s;
}
.footer-iconTop a i { font-size: 1.5rem; color: #fff; }
.footer-iconTop a:hover { box-shadow: var(--neon-glow); transform: translateY(-3px); }


/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1200px) {
    html { font-size: 90%; }
    .about-img { width: 45vw; }
}

@media (max-width: 991px) {
    header { padding: 2rem 5%; }
    header.sticky { padding: 1.5rem 5%; }
    section { padding: 8rem 5% 2rem; }
    .footer { padding: 2rem 5%; }
    
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 0;}
    .timeline-item:nth-child(even) { left: 0; }
    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot { left: 22px; }
    
    .skills-container { flex-direction: column; gap: 2rem; }
}

@media (max-width: 768px) {
    #menu-icon { display: block; }
    .navbar {
        position: absolute; top: 100%; left: 0; width: 100%;
        padding: 1rem 5%; background: var(--card-bg);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 .5rem 1rem rgba(0,0,0,.1);
        display: none; flex-direction: column; align-items: flex-start;
        backdrop-filter: blur(10px);
    }
    .navbar.active { display: flex; }
    .navbar a {
        display: block; margin: 1.2rem 0; font-size: 1.3rem;
    }
    
    .home { justify-content: center; }
    .home-content h1 { font-size: 3.5rem; }
    
    .about-content { flex-direction: column; gap: 3rem; }
    .about-img { width: 80vw; }
    
    .input-box input { width: 100%; }
}

@media (max-width: 450px) {
    html { font-size: 80%; }
    .contact form { padding: 2rem; }
}
