:root {
    /* Light Mode Variables (Default) */
    --bg-body: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #4b5563;
    /* gray-600 */
    --bg-header: rgba(62, 142, 0, 0.85);
    /* Tinted Green Glass */
    --border-header: rgba(255, 255, 255, 0.2);
    --bg-card: #f9fafb;
    /* gray-50 */
    --border-card: #e5e7eb;
    /* gray-200 */
}

/* Dark Mode Variables */
body.dark-theme {
    /* Rich Deep Green/Slate Black */
    --bg-body: #0a120a;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    /* gray-400 */
    --bg-header: rgba(26, 26, 26, 0.85);
    /* Dark Glass */
    --border-header: rgba(255, 255, 255, 0.1);
    --bg-card: rgba(255, 255, 255, 0.05);
    --border-card: rgba(255, 255, 255, 0.1);
}

/* Base Styles using Variables */
body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Night Mode Texture Overlay */
body.dark-theme::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Technical Grid Pattern for Premium Look */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    opacity: 1;
}

/* Header Styles Override */
.glass-nav {
    background: var(--bg-header) !important;
    border-bottom: 1px solid var(--border-header) !important;
}

/* Theme Toggle Button Styles */
#theme-toggle {
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 9999px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: currentColor;
}

#theme-toggle:hover {
    background-color: rgba(96, 195, 0, 0.2);
    color: #60c300;
    border-color: #60c300;
}

/* Dark Mode Specific Overrides for Tailwind Utility Classes 
   We use !important to override the utility classes present in the HTML 
*/
body.dark-theme .bg-white {
    background-color: var(--bg-body) !important;
}

body.dark-theme .bg-gray-50 {
    background-color: #0f160f !important;
    /* Slightly lighter than body */
}

body.dark-theme .bg-gray-100 {
    background-color: #1a221a !important;
}

body.dark-theme .text-dark {
    color: #ffffff !important;
}

body.dark-theme .text-gray-600 {
    color: #e5e7eb !important;
    /* gray-200 for better contrast */
}

body.dark-theme .border-gray-200 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .border-black\/10 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .bg-black\/5 {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Map Filter for Dark Mode */
body.dark-theme iframe {
    filter: grayscale(100%) invert(92%) contrast(83%);
}

/* Update Header Text for Light Mode (Green Header needs White Text) */
/* When body is Light (Default) -> Header is Green -> Text should be White */
body:not(.dark-theme) header .text-dark {
    color: white !important;
}

body:not(.dark-theme) header .border-brand {
    border-color: white !important;
    color: white !important;
}

body:not(.dark-theme) header .hover\:text-brand:hover {
    color: #1a1a1a !important;
    /* On green header, hover brand (bright green) might be hard to see. Using black or keeping white. Let's try white or dark. */
}

/* Adjust button hover in header light mode */
body:not(.dark-theme) header .hover\:bg-brand:hover {
    background-color: white !important;
    color: #3e8e00 !important;
}

/* 
   Header specific overrides for Dark Mode 
   User Request: "in night mode the letters of the header be initially white please upon passing the mouse that yes changes color to green"
*/
/* 
   Header specific overrides for Dark Mode 
   User Request: "in night mode the letters of the header be initially white please upon passing the mouse that yes changes color to green"
*/
body.dark-theme header .text-dark,
body.dark-theme header nav a {
    color: #ffffff !important;
    transition: color 0.3s ease;
}

body.dark-theme header nav a:hover,
body.dark-theme header .hover\:text-brand:hover {
    color: #60c300 !important;
    color: #60c300 !important;
    /* Green on hover */
}

/* Dynamic Logo Toggling */
.logo-night {
    display: none;
}

.logo-day {
    display: block;
}

body.dark-theme .logo-night {
    display: block;
}

body.dark-theme .logo-day {
    display: none;
}