/* --- 1. VARIABLES AND THEME LOGIC --- */
:root {
    /* DARK THEME */
    --primary-color: #2c3e50;
    --accent-color: #8f12e2;
    --text-light: #7f8c8d;
    --bg-color: #2C2c2e;
    --hero-bg-dark: linear-gradient(to bottom, #121212 80%, #2C2c2e 100%);
    --hero-bg-light: linear-gradient(to bottom, rgb(201, 201, 201) 80%, #BCB5AC 100%);
    
    --card-bg: #1a1a1c;
    --card-shadow: rgba(0, 0, 0, 0.5);
    --text-main: #e0e0e0;        /* Light gray with high contrast for maximum readability */
    --text-title: #ffffff;       
    --nav-bg: rgba(0, 0, 0, 0.39);
    --card-border: rgba(255, 255, 255, 0.1);
    --shadow-color: 0 8px 5px rgba(0, 0, 0, 0.664);
    
    --hamburger-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    --hamburger-icon-open: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%238f12e2' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- NAVBAR HEIGHT COMPENSATION FOR ANCHORS --- */
section {
    scroll-margin-top: 50px; /* Adjust this value if the navbar is taller or shorter */
}

body.light-mode {
    /* LIGHT THEME */
    --bg-color: #BCB5AC; 
    --card-bg: #f5f3f0;
    --card-shadow: rgba(0, 0, 0, 0.15);
    --text-main: #1a1a1c;        /* Anthracite black for light theme */
    --text-title: #000000;       
    --nav-bg: rgba(255, 255, 255, 0.39);
    --card-border: rgba(0, 0, 0, 0.1);
    --shadow-color: 0 8px 5px rgba(248, 244, 244, 0.664);
    
    --hamburger-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- 2. BASE AND NAVBAR (INTEGRATED LINK ANIMATION) --- */
html { scroll-behavior: smooth; }
body { 
    font-family: 'Inter', sans-serif; 
    color: var(--text-main); 
    background-color: var(--bg-color); 
    transition: background-color 0.6s ease, color 0.6s ease;
}

/* --- HAMBURGER ICON INITIALIZATION --- */
.navbar-toggler {
    padding: 0.25rem 0.6rem;
    font-size: 1.25rem;
    line-height: 1;
    background-color: transparent; /* Removes unwanted backgrounds */
    border-radius: 6px;            /* Standard rounding */
    outline: none !important;      /* Removes the annoying blue border on click */
    box-shadow: none !important;   /* Removes default Bootstrap shadows */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--text-title) !important; 
    transition: border-color 0.3s ease;
}

.navbar-toggler-icon {
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;         /* Forces the SVG to cover all space */
    transition: background-image 0.3s ease-in-out; /* Smooth icon change transition */
    background-image: var(--hamburger-icon) !important; 
}

.navbar-glass { 
    background: transparent; 
    transition: all 0.4s ease; 
    padding: 20px 0;
}

.navbar-brand, .navbar-nav .nav-link { 
    color: var(--text-title) !important; 
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-color) !important;
    transform: translateX(-4px);
    text-shadow: 0 6px 12px rgba(143, 18, 226, 0.6);
}

.navbar-glass.scrolled { 
    background: var(--nav-bg) !important; 
    backdrop-filter: blur(5px); 
    padding: 10px 0;
    border-bottom: 1px solid var(--card-border); 
}

/* Hamburger Toggler */

.navbar-toggler:not(.collapsed) {
    border-color: var(--accent-color) !important;
}

.navbar-toggler:not(.collapsed) .navbar-toggler-icon {
    background-image: var(--hamburger-icon-open) !important;
}

/* --- 3. HERO SECTION --- */
.hero-section {
    padding-top: 50px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: var(--hero-bg-light) !important;
    z-index: 1;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--hero-bg-dark);
    transition: opacity 0.6s ease-in-out;
    z-index: -1;
    opacity: 1; 
}
body.light-mode .hero-section::before { opacity: 0; }

.typewriter-text {
    font-size: 2.2rem;
    color: var(--text-light); 
    display: inline-block; 
    border-right: 3px solid var(--accent-color);
    padding-right: 8px;
    min-height: 1.2em; 
    vertical-align: middle;
}

.hero-section .lead { 
    color: var(--text-main) !important; 
    font-weight: 500; 
}

.profile-img-hero {
    width: 400px; height: 400px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    box-shadow: 0 10px 30px var(--card-shadow);
}

/* --- 4. BUTTONS: HERO & CARDS --- */
.btn-primary, .btn-outline-secondary {
    font-weight: 700 !important;
    border-radius: 8px;
    padding: 12px 30px;
    transition: all 0.3s ease !important;
    display: inline-flex;   
    align-items: center;     
    justify-content: center;  
    min-height: 50px;        
    
    
}

.btn-primary { 
    background-color: var(--accent-color) !important; 
    color: white !important; 
    border: none !important; 
}

.btn-primary:hover, .btn-outline-secondary:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 25px rgba(143, 18, 226, 0.45) !important;
}

.btn-outline-secondary { 
    color: var(--text-title) !important; 
    border: 2px solid var(--accent-color) !important; 
    background: transparent !important;
}

.btn-outline-secondary:hover {
    background: var(--accent-color) !important;
    color: white !important;
}

.custom-text-shadow{
    text-shadow: var(--shadow-color)
}

/* Card Buttons (Small) */
.project-card .btn-success { 
    font-weight: 700 !important;
    color: var(--text-title) !important; 
    border: 2px solid var(--accent-color) !important; 
    background: transparent !important;
    border-radius: 6px; 
    padding: 6px 6px !important;
    font-size: 0.85rem !important;
    transition: all 0.3s ease !important;
}

.project-card .btn-success:hover { 
    background: var(--accent-color) !important; 
    color: #ffffff !important; 
    transform: translateY(-3px);
}

/* --- 5. CARDS --- */
.project-card .card { 
    transition: all 0.4s ease; 
    background-color: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 6px 18px var(--card-shadow);
    border-radius: 18px !important;
}
.project-card .card:hover { transform: translateY(-10px); }
.img-container { height: 230px; overflow: hidden; border-radius: 18px 18px 0 0; }
.img-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }

.card h3 { color: var(--text-title) !important; }
/* The description color correctly inherits var(--text-main) */
.card p { color: var(--text-main) !important; line-height: 1.6; }

/* --- 6. FLOATING BUTTON --- */
/* --- THEME CHANGE BUTTON (FROSTED GLASS STYLE) --- */
/* --- DEFINITIVE FLOATING BUTTON FIX (FROSTED + MULTI-SHADOW) --- */

.btn-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    
    /* Frosted Glass Effect */
    background: var(--nav-bg) !important; 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    /* Icon Layout */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--accent-color) !important;
    
    /* Base Border and Shadow (Dark Theme) */
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    
    cursor: pointer;
    z-index: 2000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Dark Theme Hover: Intense purple shadow */
.btn-floating:hover {
    transform: scale(1.1) rotate(15deg);
    border-color: var(--accent-color) !important;
    box-shadow: 0 12px 40px rgba(143, 18, 226, 0.6);
}

/* --- SPECIFIC LIGHT THEME ADAPTATION --- */
body.light-mode .btn-floating {
    /* Lighter glass and more visible border for contrast */
    background: rgba(255, 255, 255, 0.45) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    /* Darker and defined shadow for light background */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Light Theme Hover: Double Shadow (Black for depth + Purple for effect) */
body.light-mode .btn-floating:hover {
    border-color: var(--accent-color) !important;
    /* The combination of two shadows makes the effect visible on beige */
    box-shadow: 
        0 15px 35px rgba(143, 18, 226, 0.5), /* Purple Glow */
        0 5px 15px rgba(0, 0, 0, 0.2);       /* Dark contact shadow */
}

/* Focus reset for visual cleanliness */
.btn-floating:focus {
    outline: none;
}

/* --- 8. MEDIA QUERIES SECTION (RESPONSIVE) --- */

/* Large Devices (Standard Desktop, Landscape Tablet) */
@media (max-width: 1199.98px) {
    .profile-img-hero {
        width: 350px;
        height: 350px;
    }

    .typewriter-text {
        font-size: 1.8rem;
    }


}

/* Medium Vertical Devices (Tablet / iPad) */
@media (max-width: 991.98px) {
    .navbar-nav .nav-link {
        padding: 12px 0 !important;
        border-bottom: 1px solid var(--card-border);
    }

    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }

    .hero-section .row {
        flex-direction: column-reverse;
    }

    .profile-img-hero {
        width: 280px;
        height: 280px;
        margin-bottom: 40px;
    }

}

/* Landscape Smartphone */
@media (max-width: 767.98px) {
    .typewriter-text {
        font-size: 1.5rem;
    }
    .hero-section{
        padding-top: 80px;
    }
    .hero-section h1 {
        font-size: 2.2rem;
    }

    .btn-primary, .btn-outline-secondary {
        width: 100%;
        margin-bottom: 10px;
    }

    .btn-floating {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .project-card .card {
        margin-bottom: 20px;
    }
}

/* Vertical phones*/
@media (max-width: 576px) {
    .hero-section{
        padding-top: 100px;
    }
    .profile-img-hero {
        width: 220px;
        height: 220px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }

}