/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;500;600;700&display=swap');

/* CSS Variables for Light Theme */
:root {
    /* Text Colors */
    --text-primary: #111;
    --text-secondary: #2c2c2c;
    --text-tertiary: #555;
    --text-quaternary: #999;

    /* Accent / Primary Colors */
    --primary-color: #07c;       /* Blue (vivid) */
    --primary-hover: #005fa3;
    --secondary-color: #00b894;     /* Teal green */
    --secondary-hover: #009578;
    --accent-color: #ff6b6b;        /* Coral red */
    --accent-hover: #e55050;

    /* Backgrounds */
    --bg-primary:    #edf2f4;
    --bg-secondary:  #d9e1e6;
    --bg-tertiary:   #c0cbd2;
    --bg-quaternary: #a2b1ba;

    /* Borders */
    --border-color:    #8d9da7;
    --border-hover:    #738791;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgb(54 69 79 / 10%), 0 0 0 1px rgb(255 255 255 / 45%);
    --shadow-md: 0 4px 10px rgb(54 69 79 / 14%), 0 1px 3px rgb(54 69 79 / 8%), 0 0 0 1px rgb(255 255 255 / 38%);
    --shadow-lg: 0 10px 24px rgb(54 69 79 / 18%), 0 3px 8px rgb(54 69 79 / 10%), 0 0 0 1px rgb(255 255 255 / 30%);

    /* Typography */
    --font-heading: 'Archivo Black', sans-serif;
    --font-subheading: 'DM Sans', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; */

    font-size: 62.5%; /* 1rem = 10px for easy calculations */

    /* Base text sizes */
    --font-size-small: clamp(1.1rem, 0.9vw, 1.3rem);  /* 11px - 13px */
    --font-size-base:  clamp(1.4rem, 1vw, 1.6rem);    /* 14px - 16px */
    --font-size-medium:  clamp(1.7rem, 1.1vw, 1.9rem);    /* 17px - 19px */
    --font-size-large:  clamp(2rem, 1.2vw, 2.2rem);    /* 20px - 22px */
    --font-size-extraLarge: clamp(2.3rem, 1.3vw, 2.5rem); /* 23px - 25px */
    

    /* Heading sizes */
    --font-size-h1: clamp(2.8rem, 5vw, 4.8rem);       /* 28px - 48px */
    --font-size-h2: clamp(2.4rem, 3vw, 3.6rem);       /* 24px - 36px */
    --font-size-h3: clamp(2rem, 2.4vw, 2.8rem);       /* 20px - 28px */
    --font-size-h4: clamp(1.8rem, 1.8vw, 2.2rem);     /* 18px - 22px */
    --font-size-h5: clamp(1.6rem, 1vw, 2rem);     /* 16px - 20px */
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2.5rem;


    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    --border-width: 2px;
    --button-text-color: white;
    --success-color: #22c55e;
    --success-bg: #dcfce7;
    --warning-color: #eab308;
    --warning-bg: #fef9c3;
    --error-color: #ef4444;
    --error-bg: #fee2e2;
    --scrollbar-thumb: #888;       /* Light mode thumb */
    --scrollbar-track: #e0e0e0;    /* Light mode track */

    /* Z-Index Layers */
    --z-base: 1;
    --z-dropdown: 100;
    --z-modal: 1000;
    --z-toast: 2000;
    --z-max: 9999;

    /*
    --spacing-3xs: clamp(0.25rem, 0.5vw, 0.5rem);   /* 4px to 8px 
    --spacing-2xs: clamp(0.5rem, 0.7vw, 0.75rem);   /* 8px to 12px 
    --spacing-xs:  clamp(0.75rem, 0.9vw, 1rem);     /* 12px to 16px 
    --spacing-sm:  clamp(1rem, 1vw, 1.25rem);       /* 16px to 20px 
    --spacing-md:  clamp(1.25rem, 1.2vw, 1.5rem);   /* 20px to 24px 
    --spacing-lg:  clamp(1.5rem, 1.5vw, 2rem);      /* 24px to 32px 
    --spacing-xl:  clamp(2rem, 2vw, 3rem);          /* 32px to 48px 
    --spacing-2xl: clamp(3rem, 3vw, 4rem);          /* 48px to 64px 
    --spacing-3xl: clamp(4rem, 5vw, 6rem);          /* 64px to 96px */

    /* Spacing System 
    --spacing-unit: 1rem;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem; */

    /* Breakpoints */

    /* Mobile First Approach 
    Breakpoint prefix	Minimum width	CSS
    sm	40rem (640px)	@media (width >= 40rem) { ... }
    md	48rem (768px)	@media (width >= 48rem) { ... }
    lg	64rem (1024px)	@media (width >= 64rem) { ... }
    xl	80rem (1280px)	@media (width >= 80rem) { ... }
    2xl	96rem (1536px)	@media (width >= 96rem) { ... }
    */

}

/* Dark Theme Variables */
[data-theme="dark"] {
    /* Text Colors */
    --text-primary: #f0f0f0;         /* Very light gray */
    --text-secondary: #cfcfcf;
    --text-tertiary: #999;
    --text-quaternary: #6f6f6f;

    /* Accent / Primary Colors (muted tones) */
    --primary-color: #07c;       /* Blue (vivid) */
    --primary-hover: #005fa3;
    --secondary-color: #00b894;     /* Teal green */
    --secondary-hover: #009578;
    --accent-color: #ff6b6b;        /* Coral red */
    --accent-hover: #e55050;

    /* Backgrounds */
    --bg-primary:     #20282d;
    --bg-secondary:   #2c373e;
    --bg-tertiary:    #3a4a54;
    --bg-quaternary:  #516673;

    /* Borders */
    --border-color: #465760;
    --border-hover: #5b717d;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-md: 0 4px 8px rgb(0 0 0 / 50%);
    --shadow-lg: 0 8px 20px rgb(0 0 0 / 60%);

    /* Buttons / UI */
    --button-text-color: #fff;
    --button-bg: var(--primary-color);
    --button-bg-hover: var(--primary-hover);
    --scrollbar-thumb: #444;       /* Dark mode thumb */
    --scrollbar-track: #1c1c1c;    /* Dark mode track */
    --success-color: #22c55e;
    --success-bg: #1c2f24;
    --warning-color: #eab308;
    --warning-bg: #2e2b15;
    --error-color: #ef4444;
    --error-bg: #2b1e1e;
}

/*
@media (max-width: 992px) {
  :root {
    --spacing-sm: clamp(0.25rem, 0.5vw, 0.5rem);
    --spacing-md: clamp(0.98rem, 0.8vw, 1rem);
    --spacing-lg: clamp(1rem, 1vw, 1.5rem);
  }
}

@media (max-width: 768px) {
  :root {
    --spacing-xs: clamp(0.75rem, 0.9vw, 1rem);
    --spacing-sm: clamp(1rem, 1vw, 1.25rem);
    --spacing-md: clamp(1.25rem, 1.2vw, 1.5rem);
    --spacing-lg: clamp(1.5rem, 1.5vw, 2rem);
  }
}

} */

/* Dark Mode Media Query */
html {
    color-scheme: dark light;
}

[data-theme="dark"], [data-theme="light"] {
    transition: background-color var(--transition-normal), color var(--transition-normal);
}


*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    background-color: var(--bg-quaternary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-normal),
                color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-subheading);
    color: var(--text-primary);
    margin: var(--spacing-sm) 0;
    font-weight: bold;
}

h1 {
    font-size: var(--font-size-h1);
}

h2 {
    font-size: var(--font-size-h2);
}

h3 {
    font-size: var(--font-size-h3);
}

h4 {
    font-size: var(--font-size-h4);
}

h5 {
    font-size: var(--font-size-h5);
}

.caption, small {
    font-size: var(--font-size-small);
}

li {
    background-color: var(--bg-tertiary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}


p {
    font-family: var(--font-body);
    font-size: var(--font-size-small);
    color: var(--text-primary);
    margin: 0;
}

a {
    font-size: var(--font-size-small);
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);

    /* transform: scale(1.1); */
}

hr {
    border: 0;
    border-top: var(--border-width) solid var(--text-secondary);
}

canvas {
    display: block;
    width: 90%;
    height: 90%;
}


.container {
    width: 90%;
    max-width: 100%;
    margin: 0 auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color var(--transition-normal),
                color var(--transition-normal);
    position: relative;
    gap: var(--spacing-xl);
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-base);
    font-weight: bold;
    font-family: var(--font-body);
    color: var(--button-text-color);
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

button:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

button:active,
button.active,
button[aria-pressed="true"] {
    background: var(--primary-hover);
    color: var(--button-text-color);
    transform: translateY(2px);
    box-shadow: inset 0 2px 4px rgb(0 0 0 / 20%);
}

button:disabled {
    background: var(--bg-tertiary);
    color: var(--text-quaternary);
    cursor: not-allowed;
    box-shadow: none;
}

table {
    width:100%;
    border-collapse: collapse;
}

thead {
    width: 100%;
    position: sticky;
    top: 0;
    font-weight: bold;
    background: var(--text-secondary);
    color: var(--bg-secondary);
    border-bottom: var(--border-width) solid var(--border-color);
    z-index: 10;
}

tbody {
    overflow-y: auto;
}

tbody tr:nth-child(odd) {
    background-color: var(--bg-secondary);
}

tbody tr:nth-child(even) {
    background-color: var(--bg-tertiary);
}

th, td {
    padding: var(--spacing-md);
    text-align: left;
}

.bouncy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-large);
    color: var(--primary-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.bouncy-btn:hover {
    transform: scale(1.06);
    background: var(--text-quaternary);  /* #FFFFFF1A; */
}

.bouncy-btn:active {
    transform: scale(0.96);
    background: var(--text-tertiary);  /* #FFFFFF1A; */
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.card {
    /* background: linear-gradient(var(--bg-secondary), var(--bg-primary)); */

    background-color: var(--bg-primary);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

input, select, textarea {
    appearance: none;

    /* -webkit-appearance: none; */

    /* -moz-appearance: none; */
    
    width: 200px;
    padding: var(--spacing-sm) var(--spacing-xl) var(--spacing-sm) var(--spacing-md); /* 10px 40px 10px 15px; */
    font-size: var(--font-size-base);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: black;
    background-color: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:  var(--shadow-sm);
}

textarea {
    resize: vertical;

    /* max-width: 80vw;
    min-height: 20vh;
    max-height: fit-content; */

    width: 100%;
}


input:hover, select:hover, textarea:hover {
    border-color:  var(--border-hover);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow:  var(--shadow-sm);
}

select option {
    padding: var(--spacing-sm);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.not-found-404 {
    width: 100%;
    height: 70vh;
    display:flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.positive {
    color: green;
}

.negative {
    color: red;
}

.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip .tooltiptext {
    width: auto;
    height: auto;
    visibility: hidden;
    background-color: var(--bg-quaternary);
    color: var(--text-primary);
    font-weight: normal;
    text-align: center;
    border-radius: 6px;
    padding: 6px;
    position: absolute;
    z-index: 20000;
    bottom: 125%; /* Position above the icon */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: var(--font-size-small);
    overflow: hidden;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.tooltip::after {
    /* The Unicode for 'info' in Material Symbols is \e88e */

    /* content: 'info'; */
    
    /* font-family: 'Material Symbols Outlined', sans-serif; */

    font-weight: normal;
    font-style: normal;
    font-size: var(--font-size-base);
    line-height: 1;
    display: inline-block;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    vertical-align: middle;
    margin-left: var(--spacing-xs);
    color: var(--primary-color);
}


::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: var(--radius-md);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    padding: var(--spacing-sm);
    cursor: pointer;
    position: relative;
    background-color: #fff;
    border: var(--border-width) solid var(--border-color);
    box-shadow:  var(--shadow-sm);
    transition: all 0.3s ease;
}

input[type="checkbox"]:hover {
    border-color: var(--border-hover);
    box-shadow:  var(--shadow-sm);
}

input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow:  var(--shadow-sm);
}

input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    box-shadow:  var(--shadow-sm);
}

/* dropdown select wrapper */
.select-wrapper {
    position: relative;
    display: inline-block;
    width: 200px;
}

.select-wrapper::after {
    content: '\25BC';
    font-size: var(--font-size-small);
    top: 50%;
    right: var(--spacing-lg);
    transform: translateY(-50%);
    position: absolute;
    color: var(--primary-color);
    pointer-events: none;
}

#autocomplete-list {
    width: 50%;
    margin: 0 auto;
    background-color: var(--bg-tertiary);
    font-family: var(--font-subheading);
    font-size: var(--font-size-medium);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 50vh;
    overflow-y: auto;
    z-index: 3000;
    text-align: center;
    align-items: center;
    border-radius: var(--radius-lg);
    border: var(--border-width) solid var(--border-color);
    border-top: none;
}

#autocomplete-list li {
    box-shadow: none;
    cursor: pointer;
}

#autocomplete-list li:hover {
    background-color: var(--primary-hover);
    box-shadow: none;
}


/* Pro subscription popup */
.pro-details {
    display: flex;
    flex-direction: column;
    text-align: center;
    height: 80vh;
    width: 28vw;
    max-width:fit-content;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
}

.pro-details h3 {
    font-family: var(--font-heading);
    width: 100%;
    background-color: var(--primary-color);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
}

.pro-details h4 {
    width: 100%;
    background-color: var(--bg-quaternary);
    padding: var(--spacing-sm);
    border-radius: var(--radius-xl);
}

.pro-details h5 {
    width: 100%;
}

/* Theme toggle functionality */
.theme-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-slider::before {
    content: "";
    font-family: 'Material Symbols Outlined', sans-serif;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    font-size: var(--font-size-h3);
    color: var(--primary-color);
    line-height: 1;
    transition: var(--transition-normal);
}

.theme-toggle-slider:hover::before {
    color: var(--primary-hover);
}

.theme-toggle-input:not(:checked) + .theme-toggle-slider::before {
    content: "dark_mode";
}

.theme-toggle-input:checked + .theme-toggle-slider::before {
    content: "light_mode";
}

/* result type toggle functionality */
.toggle-result {
    font-size: var(--font-size-h5);
    font-weight: bold;
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    z-index: 20000;
}

.resultType-toggle-wrapper {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 16px;
    margin-top: var(--spacing-sm);
}

.resultType-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.resultType-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.resultType-toggle-slider::before {
    content: "";
    font-family: 'Material Symbols Outlined', sans-serif;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    font-size: var(--font-size-h2);
    font-weight: normal;
    color: var(--primary-color);
    line-height: 1;
    transition: var(--transition-normal);
}

.resultType-toggle-slider:hover::before {
    color: var(--primary-hover);
}

.resultType-toggle-input:not(:checked) + .resultType-toggle-slider::before {
    content: "toggle_off";
}

.resultType-toggle-input:checked + .resultType-toggle-slider::before {
    content: "toggle_on";
}

.legal {
    display:flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--spacing-xl);
    background-color: var(--bg-tertiary);
    box-shadow: var(--shadow-md);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-xl);
}

.legal-list {
    display:flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--spacing-md);
    margin-left: var(--spacing-xl);
}

.legal-list h5 {
    font-weight:unset;
}


/* Medium screens (Tablets: 992px and below) */
@media (width <= 992px) {
    .body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        margin: 0;
    }

    .main {
        flex: 1;
    }

    .container {
        width: 90%;
        justify-content: center;
    }

    button {
        font-size: var(--font-size-small);
    }
}

/* Small screens (Mobile: 768px and below) */
@media (width <= 768px) {
    .body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        margin: 0;
    }

    .main {
        flex: 1;
    }

    .container {
        width: 100%;
        flex-direction: column;
        align-items: center;
        max-width: 100%;
        padding: var(--spacing-sm);
    }

    button {
        font-size: var(--font-size-small);
    }
}

/* Extra-small screens (Phones: 480px and below) */
@media (width <= 480px) {
    .body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        margin: 0;
    }

    .main {
        flex: 1;
    }

    .container {
        width: 100%;
        padding: var(--spacing-xs);
        text-align: center;
    }

    button {
        font-size: var(--font-size-small);
    }
}
