/* ======================================================= */
/* SMOOTH SCROLLING */
/* ======================================================= */

html {
    scroll-behavior: smooth; 
}

/* Custom scrollbar for a sleek dark theme */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1f2937; /* Dark Grey track */
}
::-webkit-scrollbar-thumb {
    background: #3b82f6; /* Blue thumb */
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #60a5fa; /* Lighter blue on hover */
}

/* LIGHT MODE SCROLLBAR STYLES */
.light-mode ::-webkit-scrollbar-track {
    background: #f0f0f0; 
}
.light-mode ::-webkit-scrollbar-thumb {
    background: #3b82f6; 
}


body {
    font-family: 'Inter', sans-serif; 
    background-attachment: fixed; 
    /* Smooth theme transition */
    transition: background-color 1.0s ease, color 1.0s ease, background-image 1.0s ease;
}

/* LIGHT MODE BODY OVERRIDES */
body.light-mode {
    background-image: linear-gradient(to bottom right, var(--light-bg-start, #f9fafb), var(--light-bg-end, #ffffff));
    color: var(--dark-text, #1f2937);
}


/* ======================================================= */
/* CARD STYLES */
/* ======================================================= */

.card-gradient-bg {
    background-image: linear-gradient(135deg, #2b2b2b, #1a1a1a); 
    /* Smooth card background transition */
    transition: background-image 1.0s ease, box-shadow 1.0s ease; 
}

/* LIGHT MODE CARD OVERRIDES */
.light-mode .card-gradient-bg {
    background-image: linear-gradient(135deg, #ffffff, #f0f4f7);
    color: var(--dark-text, #1f2937);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); 
}

/* LIGHT MODE CARD TEXT/TITLE OVERRIDES */
.light-mode .text-light-grey {
    color: var(--dark-text, #1f2937) !important; 
}


/* Card Glow Effect */
.card-glow {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3); 
    transition: box-shadow 0.15s ease; 
}

/* Shimmer Effect on Hover */
.card-glow:hover {
    animation: shimmer 1s infinite alternate;
}

@keyframes shimmer {
    from { 
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.5), 0 0 5px rgba(59, 130, 246, 0.2); 
    }
    to { 
        box-shadow: 0 0 25px rgba(59, 130, 246, 0.7), 0 0 10px rgba(59, 130, 246, 0.4);
    }
}

/* ======================================================= */
/* THEME TOGGLE SWITCH STYLES */
/* ======================================================= */

.theme-toggle-label {
    /* Track color set to a darker color for contrast */
    background-color: #111827; 
    position: relative; 
    /* Smaller shadow for smaller element */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); 
    overflow: hidden; 
    transition: background-color 1.0s ease; 
}

/* Base state: Dark Mode */
.light-icon {
    opacity: 0;
}

/* STATE: When Checkbox is checked (Light Mode) */
#theme-toggle:checked + .theme-toggle-label {
    background-color: var(--primary-blue, #3b82f6); 
}

#theme-toggle:checked + .theme-toggle-label .toggle-ball {
    transform: translateX(24px); 
    background-color: white; 
}

#theme-toggle:checked + .theme-toggle-label .dark-icon {
    opacity: 0; 
}

#theme-toggle:checked + .theme-toggle-label .light-icon {
    opacity: 1; 
}


/* ======================================================= */
/* BUTTON ANIMATION */
/* ======================================================= */

.animated-button {
    position: relative;
    overflow: hidden;
    z-index: 1; 
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    background-image: linear-gradient(90deg, var(--primary-blue), var(--primary-purple)); /* Merged button-gradient */
}

.animated-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(60deg, #1c1c1c, var(--primary-blue), var(--primary-purple), var(--primary-blue), #1c1c1c);
    background-size: 200% 200%; 
    z-index: -1; 
    animation: gradient-shift 10s linear infinite;
    mix-blend-mode: screen; 
    opacity: 0.9;
    transition: animation-duration 0.2s;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; } 
}

.animated-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.8);
}

.animated-button:hover::before {
    animation-duration: 3s; 
    opacity: 1;
}

/* ======================================================= */
/* CARD 3D TILT EFFECT */
/* ======================================================= */

.grid {
    perspective: 1000px;
}

.card-tilt-effect {
    transform: translateZ(0); 
    transform-origin: center bottom; 
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.27), box-shadow 0.2s ease;
    position: relative; 
}

/* Subtle Glow Indicator */
.card-tilt-effect::after {
    content: '';
    position: absolute;
    bottom: -10px; 
    left: 5%;
    width: 90%;
    height: 30px;
    background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0) 70%);
    z-index: -2; 
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(5px);
}

.card-tilt-effect:hover::after {
    opacity: 1;
}

.card-tilt-effect:hover {
    transform: translateY(-6px) rotateX(3deg) rotateY(1deg) translateZ(15px) scale(1.005);
}


/* ======================================================= */
/* KINETIC TEXT EFFECT */
/* ======================================================= */

#header-text-container {
    position: relative; 
    font-family: 'Varela Round', sans-serif;
}

.kinetic-char {
    display: inline-block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                color 0.8s ease, 
                text-shadow 0.8s ease; 
    color: var(--text-light-grey, #f0f0f0); 
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.5); 
    animation: none;
}

#header-text-container:hover .kinetic-char {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.8); 
}

.kinetic-char.text-initial-white {
    color: var(--text-light-grey, #f0f0f0) !important; 
}

.kinetic-char.text-primary-blue {
    color: #3b82f6 !important;
    text-shadow: 0 0 4px rgba(59, 130, 246, 0.5); 
}
/* LIGHT MODE KINETIC TEXT OVERRIDES */
.light-mode .kinetic-char.text-initial-white {
    color: var(--dark-text, #1f2937) !important;
}
.light-mode .kinetic-char.text-primary-blue {
    color: var(--primary-purple) !important; /* Use a darker purple-blue for contrast */
    text-shadow: none; 
}
