/* Modern CSS Overrides & Enhancements */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    /* Modern Palette with HSL */
    --primary-color: #695aa6;
    /* Keep original purple */
    --primary-rgb: 105, 90, 166;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --text-light: #f8fafc;
    --text-gray: #94a3b8;
    --accent: #d8b4fe;
    --accent-glow: rgba(105, 90, 166, 0.5);

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;

    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

html {
    height: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    /* Dark mode default */
    color: var(--text-light);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
.header-title,
.section-title {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

/* Glassmorphism Generic Class */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Navbar Enhancements */
.custom-navbar {
    background: transparent;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.custom-navbar .nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 1rem;
}

.custom-navbar .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.custom-navbar .nav-link:hover::after {
    width: 80%;
}

.custom-navbar.affix {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Header / Hero Section */
.header {
    background-image: linear-gradient(135deg, var(--bg-darker) 0%, #1e1b4b 100%);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    filter: blur(150px);
    border-radius: 50%;
    top: -100px;
    right: -100px;
    opacity: 0.2;
    animation: floating 10s infinite ease-in-out;
}

.header::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--accent);
    filter: blur(120px);
    border-radius: 50%;
    bottom: -50px;
    left: -50px;
    opacity: 0.1;
    animation: floating 14s infinite ease-in-out reverse;
}

@keyframes floating {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, 40px);
    }

    100% {
        transform: translate(0, 0);
    }
}

.header .overlay {
    background: transparent;
    /* Remove old overlay */
}

.header-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.header-title .up,
.header-title .down {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.header-subtitle {
    font-size: 1.5rem;
    color: #cbd5e1 !important;
    font-weight: 300;
}

/* Badges / Socials */
.outter {
    background: var(--bg-dark);
    border-bottom: 1px solid var(--glass-border);
}

.outter img {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 0 8px;
}

.outter img:hover {
    transform: translateY(-5px) scale(1.1);
    filter: drop-shadow(0 0 8px var(--primary-color));
}

/* Buttons */
.btn-primary,
.btn-outline-primary {
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #8b5cf6);
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

/* Sections */
.section {
    background-color: var(--bg-dark);
}

.section-title {
    color: var(--text-light);
    position: relative;
    display: inline-block;
    margin-bottom: 3rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.section-subtitle {
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

/* About Section */
.about-img-holder {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
}

.about-img-holder .about-img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
    transform: scale(1.01);
    /* Slight scale to prevent edge clipping */
}

.about-img-holder:hover .about-img {
    transform: scale(1.1);
}

.about-caption p {
    color: var(--text-gray);
    line-height: 1.8;
}

/* Experience Table Modernization */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 15px;
}

tr {
    background: rgba(30, 41, 59, 0.4);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

th {
    background: linear-gradient(to right, rgba(105, 90, 166, 0.1), transparent);
    color: var(--accent);
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
    font-size: 1.2rem;
}

td {
    padding: 15px 20px;
    color: var(--text-gray);
}

td.company {
    font-weight: 600;
    color: var(--text-light);
}

.skills-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: start;
}

.skills-list li::before {
    content: '▹';
    color: var(--primary-color);
    margin-right: 10px;
}

/* Skills Cards */
.service-card {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--glass-border);
    padding: 30px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    height: 100%;
    /* Ensure equal height */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.service-card:hover {
    background: rgba(30, 41, 59, 0.6);
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 40px rgba(105, 90, 166, 0.2);
}

.service-card .title {
    color: var(--text-light);
    margin: 20px 0;
}

.service-card .iconi {
    width: 40px;
    height: 40px;
    margin: 5px;
    object-fit: contain;
    transition: transform 0.2s;
}

.service-card .iconi:hover {
    transform: scale(1.2);
}

/* Publications */
.pub {
    background: rgba(30, 41, 59, 0.3) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-gray);
    box-shadow: none;
    transition: all 0.3s;
}

.pub:hover {
    background: rgba(30, 41, 59, 0.6) !important;
    transform: translateY(-5px);
}

.pub h5 {
    color: var(--text-light) !important;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.pub p {
    color: var(--text-gray) !important;
}

/* Contact Form */
input.form-control,
textarea.form-control {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    border-radius: 8px;
    padding: 15px;
}

input.form-control:focus,
textarea.form-control:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
    color: var(--text-light);
}

/* Footer */
.footer {
    border-top: 1px solid var(--glass-border);
    margin-top: 50px;
    padding-top: 30px;
}

.social-links .link {
    color: var(--text-gray);
    background: rgba(255, 255, 255, 0.05);
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    margin: 0 5px;
    transition: all 0.3s;
}

.social-links .link:hover {
    color: var(--white);
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* Responsive fixes */
@media (max-width: 768px) {
    .header-title {
        font-size: 2.5rem;
    }
}

/* Scrollbar Styling - Hidden by default */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
    display: none;
}

html {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

/* Hamburger Menu Override */
.nav-toggle {
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 5px;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    background-color: var(--text-light) !important;
}

/* Mobile Nav Background */
/* Mobile Nav Background */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(15, 23, 42, 0.98) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        padding: 20px;
        margin-top: 15px;
        border-radius: 10px;
        border: 1px solid var(--glass-border);
    }

    .navbar-nav .nav-link {
        color: var(--text-light) !important;
        text-align: center;
        padding: 10px 0;
    }

    .navbar-nav .nav-link:hover {
        color: var(--primary-color) !important;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 5px;
    }
}

/* =========================================
   Consistency Improvements & Visual Fixes
   ========================================= */

/* Global Font Reset & Consistency */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
span,
button,
input,
textarea,
label,
table,
th,
td,
li,
div {
    font-family: var(--font-body) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.header-title,
.section-title,
.title {
    font-family: var(--font-heading) !important;
}

/* Background Consistency - Force Dark Mode */
.section,
section {
    background-color: var(--bg-dark) !important;
    background: var(--bg-dark) !important;
    color: var(--text-light);
}

/* Fix Alternating Backgrounds from Bootstrap/Template */
.section-sm,
.bg-primary,
.bg-light,
.bg-dark {
    background-color: var(--bg-darker) !important;
}

/* Education Section Styling */
.education-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--glass-border);
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.education-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    background: rgba(30, 41, 59, 0.6);
}

.education-item .institution {
    color: var(--text-light);
    font-size: 1.1rem;
}

.education-item .degree {
    color: var(--primary-color);
    font-weight: 500;
}

.education-item .achievements {
    color: var(--text-gray);
    margin-top: 10px;
}

/* Experience Table Fixes */
table {
    background: transparent !important;
    border-spacing: 0 1rem;
    /* Gap between rows */
    width: 100%;
}

tr {
    background: rgba(30, 41, 59, 0.4) !important;
    backdrop-filter: blur(5px);
}

td,
th {
    background: transparent !important;
    border: none !important;
}

td {
    color: var(--text-light) !important;
    padding: 20px 25px;
    font-size: 1.05rem;
    line-height: 1.6;
}

td p {
    color: var(--text-light) !important;
    opacity: 0.95;
    text-align: justify;
}

/* Contact Form Container match */
#contactForm {
    background: rgba(30, 41, 59, 0.3);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

/* Contact Section Text Lightness */
.text-light {
    color: var(--text-light) !important;
}

/* Hero Button Spacing */
/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

::selection {
    background: var(--primary-color);
    color: white;
}

/* Hamburger Menu Override */
.nav-toggle {
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 5px;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    background-color: var(--text-light) !important;
}

/* Mobile Nav Background */
/* Mobile Nav Background */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(15, 23, 42, 0.98) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        padding: 20px;
        margin-top: 15px;
        border-radius: 10px;
        border: 1px solid var(--glass-border);
    }

    .navbar-nav .nav-link {
        color: var(--text-light) !important;
        text-align: center;
        padding: 10px 0;
    }

    .navbar-nav .nav-link:hover {
        color: var(--primary-color) !important;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 5px;
    }
}

/* =========================================
   Consistency Improvements & Visual Fixes
   ========================================= */

/* Global Font Reset & Consistency */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
span,
button,
input,
textarea,
label,
table,
th,
td,
li,
div {
    font-family: var(--font-body) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.header-title,
.section-title,
.title {
    font-family: var(--font-heading) !important;
}

/* Background Consistency - Force Dark Mode */
.section,
section {
    background-color: var(--bg-dark) !important;
    background: var(--bg-dark) !important;
    color: var(--text-light);
}

/* Fix Alternating Backgrounds from Bootstrap/Template */
.section-sm,
.bg-primary,
.bg-light,
.bg-dark {
    background-color: var(--bg-darker) !important;
}

/* Education Section Styling */
.education-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--glass-border);
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.education-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    background: rgba(30, 41, 59, 0.6);
}

.education-item .institution {
    color: var(--text-light);
    font-size: 1.1rem;
}

.education-item .degree {
    color: var(--primary-color);
    font-weight: 500;
}

.education-item .achievements {
    color: var(--text-gray);
    margin-top: 10px;
}

/* Experience Table Fixes */
table {
    background: transparent !important;
    border-spacing: 0 1rem;
    /* Gap between rows */
    width: 100%;
}

tr {
    background: rgba(30, 41, 59, 0.4) !important;
    backdrop-filter: blur(5px);
}

td,
th {
    background: transparent !important;
    border: none !important;
}

td {
    color: var(--text-light) !important;
    padding: 20px 25px;
    font-size: 1.05rem;
    line-height: 1.6;
}

td p {
    color: var(--text-light) !important;
    opacity: 0.95;
    text-align: justify;
}

/* Contact Form Container match */
#contactForm {
    background: rgba(30, 41, 59, 0.3);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

/* Contact Section Text Lightness */
.text-light {
    color: var(--text-light) !important;
}

/* Hero Button Spacing */
.header-btns .btn {
    margin: 10px 10px 10px 0;
    min-width: 160px;
}

.footer .social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Fix Date Input Color */
input[type="date"] {
    color: var(--text-light);
    /* Ensure text is light */
    color-scheme: dark;
    /* Hints browser to use dark controls */
}

input[type="date"]::-webkit-calendar-picker-indicator {
    /* Invert icon to be white */
    cursor: pointer;
}

/* Experience Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
    margin: 40px 0;
    border-left: 2px dotted var(--glass-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-dot {
    position: absolute;
    left: -36px;
    top: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-content {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateX(10px);
    background: rgba(30, 41, 59, 0.5);
    border-color: var(--primary-color);
}

.timeline-date {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.timeline-role {
    color: var(--text-light);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.timeline-company {
    color: var(--text-gray);
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.timeline-content ul {
    padding-left: 20px;
    margin-bottom: 0;
}

.timeline-content li {
    margin-bottom: 8px;
    color: var(--text-light);
    opacity: 0.9;
}

/* Enhanced Project Cards */
.portfolio-card {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 20px !important;
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: transparent;
}

.portfolio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 15px var(--accent-glow);
    border-color: var(--primary-color);
}

.portfolio-card .portfolio-card-img {
    transition: transform 0.6s cubic-bezier(0.215, 0.610, 0.355, 1.000);
    width: 100%;
    display: block;
    border-radius: 20px !important;
    /* Override inline styles */
}

.portfolio-card:hover .portfolio-card-img {
    transform: scale(1.12);
}

/* New Overlay Style - Dark Glass */
.portfolio-card .portfolio-card-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 23, 42, 0.85) !important;
    background-image: none !important;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    border-radius: 20px !important;
    transform: none !important;
}

.portfolio-card:hover .portfolio-card-overlay {
    opacity: 1;
    visibility: visible;
    width: 100% !important;
    height: 100% !important;
    border-radius: 20px !important;
}

/* Caption Animation */
.portfolio-card .portfolio-card-caption {
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, calc(-50% + 30px)) !important;
    -webkit-transform: translate(-50%, calc(-50% + 30px)) !important;
    -ms-transform: translate(-50%, calc(-50% + 30px)) !important;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    width: 90% !important;
    text-align: center;
    padding: 20px;
}

.portfolio-card:hover .portfolio-card-caption {
    transform: translate(-50%, -50%) !important;
    -webkit-transform: translate(-50%, -50%) !important;
    -ms-transform: translate(-50%, -50%) !important;
}

.portfolio-card h4 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolio-card p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
}