/* CSS Variables & Theme */
:root {
    --primary: #5c4ee5;
    --primary-hover: #4a3ec4;
    --text-main: #ffffff;
    --text-muted: #a0aab2;
    --glass-bg: rgba(15, 20, 30, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-family: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-family);
    color: var(--text-main);
    background-color: #050505;
    overflow-x: hidden;
    /* Native smooth-scroll interferes with custom RAF lerp & Lenis physics */
}

/* Scroll Canvas Background */
.canvas-container {
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.canvas-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(5, 5, 5, 0.15) 0%, rgba(5, 5, 5, 0.6) 100%);
    pointer-events: none;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Frame Buffering Indicator */
.frame-loader {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s;
    pointer-events: none;
}

.frame-loader.loaded {
    opacity: 0;
    transform: translateY(10px);
    visibility: hidden;
}

.frame-loader .loader-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spinLoader 0.8s linear infinite;
}

@keyframes spinLoader {
    to {
        transform: rotate(360deg);
    }
}

.frame-loader strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Main Content Overlay */
.portfolio-container {
    position: relative;
    z-index: 10;
    width: 100%;
    padding-bottom: 120px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Glassmorphism Utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

/* Luminous Theme-Border Utility for key portfolio sections & cards */
.theme-bordered {
    border: 1px solid rgba(92, 78, 229, 0.38) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(92, 78, 229, 0.08);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-bordered:hover {
    border-color: rgba(147, 112, 219, 0.7) !important;
    box-shadow: 0 15px 40px rgba(92, 78, 229, 0.25), inset 0 0 20px rgba(92, 78, 229, 0.15);
}

/* Typography & General */
a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

h2 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 15px;
}

p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 1.05rem;
    margin-bottom: 25px;
}

.highlight {
    color: var(--primary);
}

.section-subtitle {
    display: inline-block;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.center {
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

/* ====== Navbar ====== */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    z-index: 100;
    padding: 15px 30px;
    border-radius: 100px;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-icon {
    color: var(--primary);
    font-family: monospace;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
}

.nav-links a.active {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 5px;
}

/* ====== Hero Section ====== */
.hero {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding-top: 100px;
    position: relative;
}

.hero-left {
    flex: 0 0 auto;
    max-width: 420px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.hero-cta {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
}

.technologies span {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    display: block;
    margin-bottom: 10px;
}

.tech-icons {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 1.5rem;
}

.icon-box {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #3178C6;
}

.hero-right {
    position: absolute;
    top: 100px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 10;
}

/* Hero Philosophy Card (Positioned in red box area of Hero) */
.hero-philosophy-card {
    padding: 30px 32px;
    max-width: 440px;
    width: 100%;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(15, 20, 30, 0.75) 0%, rgba(30, 20, 55, 0.6) 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(92, 78, 229, 0.12);
}

.philosophy-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(92, 78, 229, 0.2);
    border: 1px solid rgba(92, 78, 229, 0.4);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    margin-bottom: 18px;
}

.hero-philosophy-quote {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.55;
    color: #ffffff;
    font-style: italic;
    margin-bottom: 14px;
}

.hero-philosophy-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0;
}

/* ====== Transparent Box for Section Headers ====== */
.section-header-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    width: 100%;
}

.boxed-subtitle {
    padding: 10px 24px;
    border-radius: 30px;
    background: rgba(15, 20, 30, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(92, 78, 229, 0.4) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(92, 78, 229, 0.12);
    display: inline-block;
    margin-bottom: 0;
}

.section-title {
    margin-bottom: 40px;
}

/* ====== About Section ====== */
.about {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 80px 20px 40px;
}

.about-content {
    display: flex;
    gap: 50px;
    align-items: center;
    padding: 40px 50px;
    border-radius: 24px;
    width: 100%;
    background: rgba(15, 20, 30, 0.55);
}

.about-left {
    flex: 1.2;
}

.about-left h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-top: 15px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.about-text {
    margin-bottom: 25px;
}

.about-text p {
    font-size: 0.98rem;
    color: #cbd5e1;
    margin-bottom: 10px;
    line-height: 1.6;
}

.qualification-line .university {
    color: var(--primary);
    font-weight: 600;
}

.about-right {
    flex: 1;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
    background: rgba(15, 20, 30, 0.6);
    border: 1px solid rgba(92, 78, 229, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(92, 78, 229, 0.15);
    border: 1px solid rgba(92, 78, 229, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary);
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ====== Technical Expertise (Skills Section - Compact View) ====== */
.skills {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 70px 20px 30px;
}

.skills-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
    width: 100%;
}

.skill-card {
    padding: 16px 14px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(15, 20, 30, 0.55);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.skill-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.skill-card-header h3 {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-main);
    line-height: 1.25;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.skill-tag {
    padding: 4px 9px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #e2e8f0;
    transition: all 0.2s ease;
}

.skill-tag:hover {
    background: rgba(92, 78, 229, 0.25);
    border-color: rgba(92, 78, 229, 0.6);
    color: #ffffff;
}

/* ====== Projects Section ====== */
.projects {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 75px 20px 35px;
    position: relative;
}

.projects::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 35%, rgba(5, 5, 10, 0.94) 0%, rgba(5, 5, 10, 0.82) 45%, rgba(5, 5, 10, 0.3) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 0;
    pointer-events: none;
    border-radius: 30px;
}

.projects > * {
    position: relative;
    z-index: 1;
}

.projects-carousel-wrapper {
    position: relative;
    width: 100%;
    margin-top: 15px;
}

.project-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 10px 5px 15px;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.project-grid::-webkit-scrollbar {
    height: 5px;
}

.project-grid::-webkit-scrollbar-thumb {
    background: rgba(92, 78, 229, 0.6);
    border-radius: 10px;
}

.project-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.project-card {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 320px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(15, 20, 30, 0.6);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-4px);
}

.project-img-wrapper {
    position: relative;
    height: 135px;
    background: #0d1117;
    overflow: hidden;
}

.project-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.project-card:hover .project-img-wrapper img {
    transform: scale(1.05);
    opacity: 1;
}

.project-number {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(15, 20, 30, 0.85);
    border: 1px solid rgba(92, 78, 229, 0.4);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
    backdrop-filter: blur(8px);
}

.project-info {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.project-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.project-info p {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex-grow: 1;
}

/* 2x2 Buttons Grid */
.project-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.btn-project {
    padding: 8px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    border: 1px solid var(--glass-border);
}

.btn-github {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-github:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-streamlit {
    background: rgba(255, 75, 75, 0.15);
    color: #ff4b4b;
    border-color: rgba(255, 75, 75, 0.35);
}

.btn-streamlit:hover {
    background: rgba(255, 75, 75, 0.3);
    border-color: rgba(255, 75, 75, 0.6);
    color: #ffffff;
}

.btn-about {
    background: rgba(92, 78, 229, 0.15);
    color: #a78bfa;
    border-color: rgba(92, 78, 229, 0.35);
}

.btn-about:hover {
    background: rgba(92, 78, 229, 0.3);
    border-color: rgba(92, 78, 229, 0.6);
    color: #ffffff;
}

.btn-spec {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}

.btn-spec:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: rgba(56, 189, 248, 0.6);
    color: #ffffff;
}

/* Carousel Navigation Buttons */
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 20, 30, 0.88);
    border: 1px solid rgba(92, 78, 229, 0.5);
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.carousel-nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav-btn.prev-btn {
    left: -20px;
}

.carousel-nav-btn.next-btn {
    right: -20px;
}

/* ====== Glass Modal Overlay System ====== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    position: relative;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 35px 30px;
    border-radius: 24px;
    background: rgba(15, 20, 30, 0.92);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(92, 78, 229, 0.15);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.modal-close:hover {
    background: rgba(255, 75, 75, 0.4);
    border-color: rgba(255, 75, 75, 0.7);
}

#modal-content-body h2 {
    font-size: 1.4rem;
    color: #ffffff;
    margin-bottom: 20px;
    padding-right: 30px;
}

.modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(92, 78, 229, 0.2);
    border: 1px solid rgba(92, 78, 229, 0.4);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.modal-text p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #cbd5e1;
}

.modal-text ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.modal-text li {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #e2e8f0;
    margin-bottom: 10px;
}

.modal-spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.modal-spec-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.9rem;
    color: #cbd5e1;
}

.modal-spec-table tr:last-child td {
    border-bottom: none;
}


/* ====== Footer / Contact Section ====== */
.footer {
    padding: 100px 20px 40px;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 80px;
    width: 100%;
}

.footer-cta {
    flex: 1;
    max-width: 520px;
    padding: 0;
    text-align: left;
}

.footer-social {
    flex: 1;
    max-width: 450px;
    padding: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 22px;
    margin-bottom: 30px;
    justify-content: flex-end;
}

.social-icons a {
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
}

.social-icons a:hover {
    transform: translateY(-3px);
}

.social-icons a.github:hover {
    background: #333333;
    border-color: #555555;
    color: #ffffff;
}

.social-icons a.linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
    color: #ffffff;
}

.social-icons a.youtube:hover {
    background: #ff0000;
    border-color: #ff0000;
    color: #ffffff;
}

.social-icons a.instagram:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    border-color: #e6683c;
    color: #ffffff;
}

.contact-info a {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-muted);
    transition: color 0.3s;
    justify-content: flex-end;
}

.contact-info a:hover {
    color: white;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
    font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        gap: 60px;
    }

    .hero-cta,
    .tech-icons {
        justify-content: center;
    }

    .hero-right {
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        align-items: center;
    }

    .about-content {
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-social {
        text-align: left;
    }

    .social-icons,
    .contact-info a {
        justify-content: flex-start;
    }
}

@media (max-width: 1024px) {
    .skills-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .project-grid,
    .skills-cards-grid {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2.5rem;
    }
}

.certificate-preview {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.certificate-container {
    position: relative;
    max-width: 1000px;
    max-height: 90vh;
}

.certificate-container img {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 10px;
}

.certificate-close {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: white;
    color: black;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}
.cert-btns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
}

.cert-btns .btn {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}

/* Student Volunteer - full row */
.cert-btns .btn:last-child {
    grid-column: 1 / -1;
}

.education-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.education-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
}

.education-item > i {
    font-size: 17px;
    min-width: 22px;
}

.education-item div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.education-item strong {
    font-size: 13px;
}

.education-item span {
    font-size: 12px;
    opacity: 0.8;
}

/* Neon Purple CGPA Box */
.cgpa-box {
    margin: 10px auto 2px;
    padding: 12px 40px;
    min-width: 110px;
    text-align: center;
    border-radius: 12px;

    border: 1px solid #b026ff;

    box-shadow:
        0 0 6px #b026ff,
        0 0 15px rgba(176, 38, 255, 0.8),
        0 0 30px rgba(176, 38, 255, 0.5);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.cgpa-box span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cgpa-box strong {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    text-shadow:
        0 0 5px #b026ff,
        0 0 12px #b026ff;
}

.cgpa-box small {
    font-size: 10px;
    opacity: 0.7;
}

/* ====== Custom Contact Form Modal ====== */
.cf-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.cf-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cf-card {
    position: relative;
    max-width: 700px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    padding: 25px 35px;
    border-radius: 20px;
    background: rgba(15, 20, 30, 0.95);
    border: 1px solid rgba(92, 78, 229, 0.5);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(176, 38, 255, 0.15);
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cf-overlay.active .cf-card {
    transform: translateY(0) scale(1);
}

.cf-close {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0aab2;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cf-close:hover {
    background: rgba(255, 75, 75, 0.2);
    border-color: rgba(255, 75, 75, 0.5);
    color: #ff4b4b;
    transform: rotate(90deg);
}

.cf-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.cf-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(92, 78, 229, 0.2), rgba(176, 38, 255, 0.2));
    border: 1px solid rgba(176, 38, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #b026ff;
    box-shadow: 0 0 15px rgba(176, 38, 255, 0.2);
}

.cf-header h2 {
    font-size: 1.5rem;
    margin-bottom: 2px;
    color: #fff;
}

.cf-header p {
    margin: 0;
    font-size: 0.95rem;
    color: #a0aab2;
}

.cf-row {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.cf-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.cf-row .cf-field {
    margin-bottom: 0;
}

.cf-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.cf-req {
    color: #ff4b4b;
}

.cf-field input,
.cf-field select,
.cf-field textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.cf-field input:focus,
.cf-field select:focus,
.cf-field textarea:focus {
    outline: none;
    border-color: #b026ff;
    box-shadow: 0 0 0 3px rgba(176, 38, 255, 0.15);
    background: rgba(0, 0, 0, 0.6);
}

.cf-field select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0aab2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.cf-field select option {
    background: #0f141e;
    color: #fff;
}

.cf-field textarea {
    resize: vertical;
    min-height: 60px;
}

.cf-err {
    color: #ff4b4b;
    font-size: 0.8rem;
    margin-top: 5px;
    min-height: 16px;
}

.cf-field.error input,
.cf-field.error select,
.cf-field.error textarea {
    border-color: #ff4b4b;
    background: rgba(255, 75, 75, 0.05);
}

.cf-submit {
    width: 100%;
    padding: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #5c4ee5, #b026ff);
    border: none;
    box-shadow: 0 8px 20px rgba(176, 38, 255, 0.3);
    margin-top: 5px;
    color: #fff;
    cursor: pointer;
}

.cf-submit:hover {
    box-shadow: 0 12px 25px rgba(176, 38, 255, 0.5);
    transform: translateY(-2px);
}

.cf-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Success State */
.cf-success {
    text-align: center;
    padding: 40px 20px;
}

.cf-success-icon {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.cf-success h3 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 10px;
}

.cf-success p {
    color: #a0aab2;
    margin-bottom: 30px;
}

/* Error Banner */
.cf-error-banner {
    background: rgba(255, 75, 75, 0.15);
    border: 1px solid rgba(255, 75, 75, 0.4);
    color: #ff4b4b;
    padding: 12px 20px;
    border-radius: 10px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .cf-row {
        flex-direction: column;
        gap: 0;
    }
    
    .cf-card {
        padding: 30px 20px;
    }
}