/* ROOT THEME CONFIG */
:root {
    --primary: #6c5ce7;
    --blue: #0074d9;
    --yellow: #ffdc00;
    --green: #2ecc40;
    --radius: 20px;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

html[data-theme="dark"] {
    --bg-primary: #0b0c10;
    --bg-panel-alt: rgba(255, 255, 255, 0.02);
    --card-bg: #171822;
    --text-main: #f5f5f5;
    --text-muted: #9aa0aa;
    --nav-bg: rgba(23, 24, 34, 0.95);
    --border: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] {
    --bg-primary: #f7f8fb;
    --bg-panel-alt: rgba(0, 0, 0, 0.02);
    --card-bg: #ffffff;
    --text-main: #111216;
    --text-muted: #5b6270;
    --nav-bg: rgba(255, 255, 255, 0.98);
    --border: rgba(0, 0, 0, 0.1);
}

/* --- GLOBAL TEXT VISIBILITY FIX --- */
p {
    color: var(--text-main); /* Forces all p tags to follow the theme */
    transition: color 0.4s ease;
}

/* Overriding Bootstrap's text-muted for better contrast in dark mode */
.text-muted {
    color: var(--text-muted) !important;
}

/* Specific fix for the Hero and About descriptions */
.lead, .text-white-50 {
    color: var(--text-muted) !important;
}

/* Ensuring the "Technical View" and other small labels are visible */
span.text-muted, .small.text-muted {
    color: var(--text-muted) !important;
}

/* BODY */
body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: 'Inter', system-ui, sans-serif;
    transition: background 0.4s ease;
}

/* BG PARTICLES */
#bgParticles {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.4;
}

/* LOADER */
.loader {
    position: fixed;
    inset: 0;
    background: #0b0c10;
    z-index: 9999;
    transition: 0.8s;
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-typed {
    color: var(--primary);
    font-size: 28px;
    font-weight: bold;
}

/* THEME TOGGLE */
.theme-toggle {
    position: fixed;
    right: 30px;
    bottom: 110px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    z-index: 2500;
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* TOP LOGO */
.top-logo {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2500;
}

/* WHATSAPP BOX */
.whatsapp-box {
    position: fixed;
    right: 30px;
    bottom: 180px;
    z-index: 2500;
}

/* APP MAIN */
.app-main {
    overflow-y: auto;
    scroll-behavior: smooth;
    padding-bottom: 84px;
}

.panel {
    min-height: 100vh;
    padding: 60px 0;
}

/* HOME SECTION */
.greeting-pill {
    background: rgba(0, 116, 217, 0.15);
    color: var(--primary);
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
}

.hero-image-container {
    position: relative;
    width: 420px; height: 420px;
    margin: auto;
}

.circle-bg {
    position: absolute; inset: 0;
    background: var(--primary);
    border-radius: 50%;
    z-index: 1;
}

.glass-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 18px;
    border-radius: 15px;
    z-index: 10;
    color: white;
    animation: float 4s ease-in-out infinite;
}

.card-1 {
    top: 20%;
    left: -40px;
    animation-delay: 0s;
}

.card-2 {
    bottom: 25%;
    right: -30px;
    animation-delay: 2s;
}

.small-text {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

html[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.img-portrait {
    position: relative;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 2;
    border: 12px solid var(--bg-primary);
}

.experience-ribbon {
    position: absolute;
    bottom: 30px; right: -20px;
    background: var(--primary);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    transform: rotate(-10deg);
    z-index: 3;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.wave {
    display: inline-block;
    animation: wave-animation 2.5s infinite;
    transform-origin: 70% 70%;
}

.wave i {
    color: var(--yellow) !important;
}

@keyframes wave-animation {
    0% { transform: rotate( 0.0deg) }
   10% { transform: rotate(14.0deg) }  /* The waving motion */
   20% { transform: rotate(-8.0deg) }
   30% { transform: rotate(14.0deg) }
   40% { transform: rotate(-4.0deg) }
   50% { transform: rotate(10.0deg) }
   60% { transform: rotate( 0.0deg) }  /* Return to rest */
  100% { transform: rotate( 0.0deg) }
}

/* ABOUT SECTION */
.dual-image-layout {
    position: relative;
    padding: 40px;
}

.img-side-small {
    position: absolute;
    top: 0;
    left: 0;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    z-index: 2;
    object-fit: cover;
    border: 5px solid var(--bg-primary);
}

.circle-frame {
    border-radius: 50%;
    overflow: hidden;
    width: 380px;
    height: 380px;
    margin-left: 60px;
    border: 2px solid var(--border);
}

.img-main-circle { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.floating-label-circle {
    position: absolute; 
    bottom: 20px; 
    left: 40px;
    background: var(--primary); 
    color: white;
    width: 100px; 
    height: 100px; 
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    text-align: center; 
    font-size: 10px; 
    font-weight: bold;
    z-index: 4; 
    padding: 10px;
}

/* SERVICES SECTION */
.next-service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.next-service-item:hover {
    background: var(--bg-panel-alt);
    border-radius: var(--radius);
    padding-left: 35px;
}

.service-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.bg-blue-soft {
    background: rgba(0, 116, 217, 0.1);
    color: var(--blue);
}

.bg-yellow-soft {
    background: rgba(255, 220, 0, 0.1);
    color: var(--yellow);
}

.bg-green-soft {
    background: rgba(46, 204, 64, 0.1);
    color: var(--green);
}

.btn-arrow-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    transition: 0.3s;
}

.next-service-item:hover .btn-arrow-link {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tilt-img {
    transform: perspective(1000px) rotateY(-15deg) rotateX(5deg);
    box-shadow: -20px 20px 50px rgba(0,0,0,0.3);
    border-radius: 10px;
}

/* PROCESS SECTION */
.process-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    transition: var(--transition);
    height: 100%;
}

.process-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(0, 116, 217, 0.1);
}

.process-number {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 3rem;
    font-weight: 900;
    opacity: 0.05;
    color: var(--yellow) !important;
}

.process-icon {
    font-size: 2.5rem;
    color: var(--primary);
    background: rgba(0, 116, 217, 0.1);
    width: 80px;
    height: 80px;
    line-height: 80px;
    margin: 0 auto;
    border-radius: 50%;
}

/* PORTFOLIO SECTION */
.tracking-widest {
    letter-spacing: 2px;
}

.skill-circle { padding: 20px;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.skill-val {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.skill-name {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem; opacity: 0.7;
}

.progress-container {
    height: 10px;
    background: var(--bg-panel-alt);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

.progress-glow {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--blue));
    border-radius: 20px;
    position: relative;
    box-shadow: 0 0 15px rgba(0, 116, 217, 0.4);
    transition: width 1.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    animation: progress-shine 3s infinite linear;
}

.progress-glow::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.2),
        transparent
    );
    animation: shine-move 2s infinite;
}

@keyframes shine-move {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* FAQ SECTION */
.accordion-button {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 20px 25px;
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    border-color: var(--yellow) !important;
    color: var(--yellow) !important;
}

.accordion-button::after {
    filter: invert(0.5); /* Adjusts arrow color for visibility */
}

html[data-theme="dark"] .accordion-button::after {
    filter: invert(1);
}

.accordion-item {
    background: transparent;
}

.accordion-body {
    padding: 10px 25px 20px 25px;
    line-height: 1.6;
}

/* CONTACT SECTION */
.contact-card {
    background: linear-gradient(135deg, var(--blue) 0%, #a29bfe 100%) !important;
}

/* ===== Bottom Navigation ===== */
.app-nav {
    background: rgba(23, 24, 34, 0.85);
    backdrop-filter: blur(10px);
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    flex-wrap: nowrap;
}
html[data-theme="light"] .app-nav {
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.logo {
    flex-shrink: 0;
}
.logo-img {
    height: 60px;
    width: auto;
}
.nav-items {
    gap: 8px;
}
.nav-item-btn {
    background: none;
    border: none;
    color: inherit;
    padding: 8px 12px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition);
}
.nav-item-btn:hover {
    background: rgba(255, 220, 0, 0.16);
    transform: translateY(-1px);
}
.nav-item-btn .bi {
    font-size: 20px;
}
.nav-label {
    position: absolute;
    top: -26px;
    opacity: 0;
    background: var(--yellow);
    color: #111;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    transition: var(--transition);
}
.nav-item-btn:hover .nav-label {
    opacity: 1;
    transform: translateY(-4px);
}
.whatsapp-btn .btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.whatsapp-btn .bi {
    font-size: 18px;
}

.hamburger-btn {
    display: none;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile Devices (phones, <768px) */
@media (max-width: 767px) {
    .app-nav {
        justify-content: space-between;
        position: fixed;
        /* padding: 0 4px !important; */
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        flex-direction: row;
        align-items: center;
        background: var(--nav-bg);
        backdrop-filter: blur(10px);
        height: auto;
    }

    .logo {
        width: 120px;
        height: auto;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .logo-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .nav-items {
        flex: 1;
        justify-content: space-around;
        gap: 2px;
        flex-direction: row;
        width: 100%;
        max-width: none;
        display: none !important; /* Hidden by default */
        position: absolute;
        bottom: 100%;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(10px);
        padding: 0 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 1001;
    }

    .nav-items.active {
        display: flex !important;
    }

    .nav-item-btn {
        padding: 4px 6px;
        min-width: auto;
        flex-shrink: 1;
        flex: 1;
        max-width: none;
    }

    .whatsapp-btn {
        display: none;
    }

    .hamburger-btn {
        display: block !important;
        background: var(--card-bg);
        border: 1px solid var(--border);
        color: var(--text-main);
    }

    .hamburger-btn .btn {
        background: var(--card-bg) !important;
        border-color: var(--border) !important;
        color: var(--text-main) !important;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .app-nav .logo {
        display: block;
    }
}

/* Extra Small Devices (phones, 425px to 575px) */
@media (max-width: 575.98px) {
    .nav-items {
        display: none !important;
    }

    .nav-items.active {
        display: flex !important;
    }

    .hamburger-btn {
        display: block !important;
    }

    .whatsapp-btn {
        display: none;
    }

    .app-main {
        padding-bottom: 76px;
    }

    .panel {
        min-height: auto;
        padding: 40px 0;
    }

    /* Home Section */
    .greeting-pill {
        padding: 6px 16px;
        font-size: 14px;
    }

    .display-2 {
        font-size: 2.5rem;
    }

    .lead {
        font-size: 1rem;
        line-height: 1.5;
    }

    .d-flex.gap-3 {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .hero-image-container {
        width: 280px;
        height: 280px;
        margin: 40px auto 0;
    }

    .glass-card {
        padding: 8px 12px;
        font-size: 12px;
    }

    .card-1, .card-2 {
        left: -20px;
        right: auto;
    }

    .card-2 {
        right: -20px;
        left: auto;
    }

    .experience-ribbon {
        bottom: 20px;
        right: -10px;
        padding: 6px 16px;
        font-size: 12px;
    }

    /* About Section */
    .dual-image-layout {
        /* flex-direction: column; */
        gap: 20px;
        padding: 20px;
        text-align: center;
        overflow: hidden;
    }

    .img-side-small {
        width: 50px;
        height: 50px;
    }

    .circle-frame {
        width: 250px;
        height: 250px;
    }

    .floating-label-circle {
        width: 80px;
        height: 80px;
        font-size: 9px;
        bottom: 15px;
        left: 30px;
    }

    .display-5 {
        font-size: 2rem;
    }

    /* Services Section */
    .next-service-item {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .next-service-item:hover {
        padding-left: 20px;
    }

    .service-icon-box {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .tilt-img {
        transform: none;
        margin: 20px auto;
        max-width: 100%;
        height: auto;
    }

    /* Process Section */
    .process-card {
        margin-bottom: 20px;
    }

    .process-number {
        font-size: 2rem;
        top: 5px;
        right: 15px;
    }

    .process-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
        line-height: 60px;
    }

    /* Portfolio Section */
    .skill-item {
        margin-bottom: 30px;
    }

    /* FAQ Section */
    .accordion-button {
        padding: 15px 20px;
        font-size: 14px;
    }

    .accordion-body {
        padding: 5px 20px 15px;
        font-size: 14px;
    }

    /* Contact Section */
    .contact-card {
        margin: 20px;
        padding: 30px 20px !important;
    }

    .display-5 {
        font-size: 1.8rem;
    }
}

/* Small Devices (phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hamburger-btn {
        display: block !important;
    }

    .panel {
        padding: 50px 0;
    }

    .hero-image-container {
        width: 320px;
        height: 320px;
    }

    .circle-frame {
        width: 300px;
        height: 300px;
    }

    .dual-image-layout {
        padding: 30px;
    }

    .img-side-small {
        width: 120px;
        height: 120px;
    }

    .floating-label-circle {
        width: 90px;
        height: 90px;
        font-size: 9px;
    }

    .nav-item-btn {
        padding: 6px 10px;
    }

    .nav-item-btn .bi {
        font-size: 16px;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .panel {
        padding: 60px 0;
    }

    .hero-image-container {
        width: 350px;
        height: 350px;
    }

    .circle-frame {
        width: 320px;
        height: 320px;
        margin-left: 40px;
    }

    .dual-image-layout {
        padding: 35px;
    }

    .img-side-small {
        width: 160px;
        height: 160px;
    }

    .floating-label-circle {
        width: 95px;
        height: 95px;
        font-size: 10px;
    }

    .next-service-item {
        padding: 22px;
    }

    .service-icon-box {
        width: 55px;
        height: 55px;
    }

    .process-number {
        font-size: 2.5rem;
    }

    .process-icon {
        width: 70px;
        height: 70px;
        line-height: 70px;
        font-size: 2.2rem;
    }

    .nav-item-btn {
        padding: 7px 11px;
    }

    .nav-item-btn .bi {
        font-size: 18px;
    }
}

/* General Mobile Adjustments */
@media (max-width: 991.98px) {
    .panel {
        min-height: auto;
    }

    .d-lg-block {
        display: none !important;
    }

    .d-lg-none {
        display: block !important;
    }

    .text-start {
        text-align: center !important;
    }

    .ps-lg-5 {
        padding-left: 0 !important;
    }

    .mb-lg-0 {
        margin-bottom: 40px !important;
    }

    .mt-lg-0 {
        margin-top: 0 !important;
    }

    .col-lg-6 {
        margin-bottom: 40px;
    }

    .col-lg-6:last-child {
        margin-bottom: 0;
    }

    .row.align-items-center {
        text-align: center;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 20px;
    }

    /* Keep nav in row layout */
    .app-nav {
        flex-direction: row !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-item-btn:hover .nav-label {
        opacity: 0;
    }

    .next-service-item:hover {
        background: transparent;
        padding-left: 25px;
    }

    .process-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .img-portrait,
    .img-main-circle,
    .img-side-small {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

html[data-theme="light"] .logo-img {
    filter: invert(0.85);
}

/* UI UTILS */
.app-card {
    background-color: var(--card-bg) !important;
    color: var(--text-main);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
}

html[data-theme="dark"] .form-control {
    background-color: rgba(255,255,255,0.05);
    border-color: var(--border);
    color: white;
}

html[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}
