/* --- GLOBAL FEATURES --- */

/* Base body colors for theme toggle */
body {
    background-color: #111827; /* Gray-900 */
    color: #ffffff;
    transition: background-color 0.3s, color 0.3s;
    position: relative;
}

/* Global Tech Grid Background */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
      linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

body.light-mode {
    background-color: #ffffff !important;
    color: #111827 !important;
}

body.light-mode::before {
    background-image: 
      linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

/* --- LIGHT MODE OVERRIDES --- */

/* Handle classes on body or children */
body.light-mode,
body.light-mode .text-white,
body.light-mode .text-gray-300,
body.light-mode .text-gray-400 {
    color: #1f2937 !important; /* Gray-800 */
}

body.light-mode .text-gray-500 {
    color: #4b5563 !important; /* Gray-600 */
}

/* Headings */
body.light-mode h1, 
body.light-mode h2, 
body.light-mode h3,
body.light-mode h4,
body.light-mode h5,
body.light-mode h6 {
    color: #111827 !important;
}

/* Backgrounds */
body.light-mode .bg-gray-900,
body.light-mode .bg-gray-800,
body.light-mode .bg-gray-900\/60,
body.light-mode .bg-gray-900\/70 {
    background-color: #f9fafb !important; /* Gray-50 */
}

body.light-mode .bg-opacity-60,
body.light-mode .bg-opacity-70 {
    background-color: rgba(255, 255, 255, 0.85) !important;
}

/* Borders */
body.light-mode .border-white\/5,
body.light-mode .border-gray-800 {
    border-color: #e5e7eb !important;
}

/* Navigation Overrides */
body.light-mode nav,
body.light-mode footer {
    background-color: rgba(255, 255, 255, 0.8) !important;
    border-color: #e5e7eb !important;
    backdrop-filter: blur(15px);
}

body.light-mode nav .text-white,
body.light-mode nav .text-gray-300,
body.light-mode footer .text-white,
body.light-mode footer .text-gray-300,
body.light-mode footer .text-gray-400,
body.light-mode footer p,
body.light-mode footer span {
    color: #111827 !important;
}

body.light-mode #navbar-sticky ul {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
}

@media (min-width: 768px) {
    body.light-mode #navbar-sticky ul {
        background-color: transparent !important;
    }
}

/* Card and Glass Upgrades */
body.light-mode .item-card,
body.light-mode .glass-card {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

body.light-mode .item-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    border-color: #818cf8 !important;
}

/* Project Card Specifics */
body.light-mode .item-description,
body.light-mode .item-description ul li {
    color: #374151 !important; /* Gray-700 */
}

/* Fancy Heading */
body.light-mode .heading-text {
    color: #111827 !important;
}

/* Ambient Orbs - Make them softer in light mode */
body.light-mode .ambient-orb {
    opacity: 0.15;
}

/* CV Button */
body.light-mode a[href*=".pdf"],
body.light-mode .bg-gray-800.text-white {
    background-color: #111827 !important;
    color: #ffffff !important;
}

body.light-mode a[href*=".pdf"]:hover {
    background-color: #374151 !important;
}

body.light-mode .project-tech-tag,
body.light-mode .bg-indigo-500\/10,
body.light-mode .bg-pink-500\/10 {
    background-color: #f3f4f6 !important; /* Gray-100 */
    color: #4f46e5 !important; /* Indigo-600 */
    border: 1px solid #e5e7eb;
}

/* Specific Badge colors */
body.light-mode .bg-pink-500\/10 {
    color: #db2777 !important; /* Pink-600 */
    background-color: #fdf2f8 !important; /* Pink-50 */
}

/* --- UI COMPONENTS --- */

/* Theme Toggle Button */
#theme-toggle { 
    position: fixed; 
    top: 85px; 
    right: 20px; 
    background-color: #374151; 
    color: white; 
    border-radius: 50%; 
    width: 45px; 
    height: 45px; 
    z-index: 200; 
    cursor: pointer; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#theme-toggle:hover {
    transform: scale(1.1);
    background-color: #4b5563;
}

body.light-mode #theme-toggle { 
    background-color: #ffffff; 
    color: #111827; 
    border-color: #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Back to Top Button */
#back-to-top { 
    display: none; 
}
#back-to-top.show { 
    display: flex;
    justify-content: center;
    align-items: center; 
    position: fixed; 
    bottom: 30px; 
    right: 20px; 
    background-color: #374151; 
    color: white; 
    border-radius: 50%; 
    width: 45px; 
    height: 45px; 
    z-index: 200; 
    cursor: pointer; 
    font-size: 22px; 
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#back-to-top:hover {
    transform: translateY(-5px);
    background-color: #4b5563;
}

body.light-mode #back-to-top.show { 
    background-color: #ffffff; 
    color: #111827; 
    border-color: #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}