/* Modern Styles Override */

:root {
    --bg-color: #ffffff;
    --text-color: #212529;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 0.5);
    --primary-color: #F85C70;
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --text-color: #e0e0e0;
    --card-bg: rgba(26, 26, 46, 0.8);
    --card-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

/* Header with Layered Background Image + Animated Gradient */
.header {
    /* Layer 1: Professional background image */
    background-image: url('/static/assets/imgswebp/header.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

/* Layer 2: Animated gradient overlay with transparency */
.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg,
            rgba(238, 119, 82, 0.6),
            rgba(231, 60, 126, 0.6),
            rgba(35, 166, 213, 0.6),
            rgba(35, 213, 171, 0.6));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: 0;
    pointer-events: none;
}

/* Particles Container - Layer 3 */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.header .container {
    position: relative;
    z-index: 2;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Glassmorphism Cards */
.card,
.blog-card,
.portfolio-item,
.portfolio2-item2,
.portfolio3-item3,
.contact-form-card,
.contact-info-card,
.about-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid var(--card-border);
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--card-border) !important;
}

.card:hover,
.blog-card:hover,
.portfolio-item:hover,
.portfolio2-item2:hover,
.portfolio3-item3:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Dark Mode Specifics */
[data-theme="dark"] .text-dark {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .bg-white {
    background-color: var(--bg-color) !important;
}

[data-theme="dark"] .navbar-light .navbar-nav .nav-link {
    color: #e0e0e0;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #fff;
}

[data-theme="dark"] p {
    color: #ccc;
}

/* Toggle Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: 15px;
    padding-top: 5px;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 46px;
    margin-bottom: 0;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

.slider:before {
    background-color: #fff;
    bottom: 3px;
    content: "";
    height: 18px;
    left: 3px;
    position: absolute;
    transition: .4s;
    width: 18px;
}

input:checked+.slider {
    background-color: #F85C70;
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Typing Effect Cursor */
.typing-cursor {
    display: inline-block;
    width: 2px;
    background-color: #fff;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Header Mono - Fixed Height to Prevent Bouncing */
.header-mono {
    height: 1.5em;
    line-height: 1.5em;
    display: block;
    overflow: hidden;
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animated Skill Bars */
.progress-bar {
    width: 0 !important;
    transition: width 1.5s ease-in-out;
    position: relative;
    overflow: visible;
}

.progress-bar.animated {
    width: var(--target-width) !important;
}

.progress-bar::after {
    content: "";
    display: none;
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    font-weight: bold;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease 1.5s;
}

.progress-bar.animated::after {
    opacity: 1;
}

/* Enhanced Card Hover Effects */
.blog-card {
    overflow: hidden;
    position: relative;
}

.blog-card .img-holder {
    overflow: hidden;
    transition: transform 0.3s ease;
}

.blog-card:hover .img-holder img {
    transform: scale(1.1);
    transition: transform 0.5s ease;
}

/* Project Modal Styles */
.project-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    margin: 3% auto;
    padding: 0;
    border: 1px solid var(--card-border);
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.4s ease;
    position: relative;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
}

.modal-body {
    padding: 30px;
    color: var(--text-color);
}

.modal-body img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 20px;
}

.close-modal {
    color: #aaa;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
    color: #F85C70;
}

/* Stats Counter Animation */
.stat-number {
    display: inline-block;
}

/* Smooth Page Transitions */
.page-transition {
    animation: pageLoad 0.5s ease;
}

@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
    }
}

/* Enhanced Button Hover */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Social Icons Pulse Effect */
.social-icons .social-link {
    transition: all 0.3s ease;
}

.social-icons .social-link:hover {
    transform: translateY(-3px) scale(1.1);
    color: #F85C70 !important;
}

/* Scroll to Top Button Enhancement */
.btn-component {
    box-shadow: 0 4px 15px rgba(248, 92, 112, 0.4);
    transition: all 0.3s ease;
    position: fixed !important;
    /* Ensure it stays fixed */
}

.btn-component:hover {
    box-shadow: 0 6px 20px rgba(248, 92, 112, 0.6);
    right: 0 !important;
    /* Ensure it slides out fully */
}

/* Prevent layout shift on hover */
.btn-component:hover i {
    margin-right: 20px !important;
    /* Keep original margin */
    opacity: 1 !important;
    /* Keep icon visible or at least occupying space */
    transform: none !important;
    /* Prevent movement that might affect layout */
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-body {
        padding: 20px;
    }

    .progress-bar::after {
        display: none;
    }
}

/* Dark Mode Table Styles */
[data-theme="dark"] .table {
    color: var(--text-color);
    background-color: transparent;
}

[data-theme="dark"] .table th,
[data-theme="dark"] .table td {
    border-color: var(--card-border);
    color: var(--text-color);
}

[data-theme="dark"] .table thead th {
    border-bottom-color: var(--card-border);
    color: #fff;
}

[data-theme="dark"] .table-hover tbody tr:hover {
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Contact Particles */
#particles-contact {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    background: #1a1a2e;
    pointer-events: none;
}

.section.contact {
    position: relative;
    background: #1a1a2e;
}

/* --- FIX: Force White Text on Always-Dark Components --- */

/* Navbar Brand */
.navbar .brand-title,
.navbar .brand-subtitle {
    color: #fff !important;
}

/* Contact Cards - Always Dark Theme */
.contact-form-card,
.contact-info-card {
    background: rgba(26, 26, 46, 0.95) !important;
    /* Ensure dark background */
    color: #fff !important;
}

.contact-form-card h1,
.contact-form-card h2,
.contact-form-card h3,
.contact-form-card h4,
.contact-form-card h5,
.contact-form-card h6,
.contact-info-card h1,
.contact-info-card h2,
.contact-info-card h3,
.contact-info-card h4,
.contact-info-card h5,
.contact-info-card h6 {
    color: #fff !important;
}

.contact-form-card p,
.contact-info-card p,
.contact-info-card .text-muted {
    color: #e0e0e0 !important;
}

/* Ensure form labels/inputs are visible if they inherit */
.contact-form-card label {
    color: #fff !important;
}