/* ========================================================================
              CSS Variables
              ======================================================================== */
:root {
    --bg-color: #f8f9fa;
    --bg-secondary-color: #f1f3f5;
    --text-color: #212529;
    --heading-color: #0b2241;
    --accent-color: #4a00e0;
    --accent-secondary: #8e2de2;
    --gradient-main: linear-gradient(90deg, #4a00e0, #8e2de2);
    --gradient-text: linear-gradient(90deg, #0b2241, #4a00e0);
    --light-gray: #e9ecef;
    --dark-gray: #6c757d;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --nav-border: var(--light-gray);
    --cta-bg: var(--light-gray);
    --grid-color: rgba(0, 0, 0, 0.05);
    --card-bg: #fff;
    --card-border: var(--light-gray);
    --primary-button-bg: var(--accent-color);
    --primary-button-text: #fff;
    --warning-button-bg: #ee9d39;
    --icon-color: #6c757d;
    /* Messaging Page Specific */
    --received-msg-bg: #fff;
    --sent-msg-bg: #4a00e0;
    --sent-msg-text: #fff;
    --msg-metadata-color: #6c757d;
    --input-bg: #fff;
    --input-border: #dee2e6;
    --active-thread-bg: #e9ecef;
    --success-color: #28a745;
    --success-hover: #218838;
    --info-color: #007bff;
    --info-hover: #0056b3;
    --danger-color: #ca3535;
    --danger-hover: #ff0000;
    /* Scrollbar colors for light mode */
    --scrollbar-track: #fff;
    --scrollbar-thumb: #adb5bd;
    --primary-color: #4a00e0;
    --primary-text: #4a00e0;
    /*SPINNER*/
    --sm-color1: #4a00e0; /* light theme start */
    --sm-color2: #8e2de2; /* light theme end   */
    --sm-spinner-size: 64px; /* outer widget size */
    --sm-spinner-thickness: 6px; /* ring thickness    */
    --sm-s-size: calc(var(--sm-spinner-size)*0.8); /* S character size */
    --sm-orbit-radius: calc( var(--sm-spinner-size)/2 - var(--sm-s-size)/2 - var(--sm-spinner-thickness)*0.5 );
    --sm-s-size: 96px; /* bigger S */
    --sm-spinner-size: 120px; /* bigger ring */
}

body.dark-mode {
    --bg-color: #0d0f18;
    --bg-secondary-color: #1a1d26;
    --text-color: #e0e7ff;
    --heading-color: #e0e7ff;
    --accent-color: #00e5ff;
    --accent-secondary: #8e2de2;
    --gradient-main: linear-gradient(90deg, #00e5ff, #8e2de2);
    --gradient-text: linear-gradient(90deg, #00e5ff, #8e2de2);
    /*--light-gray: #1a1d26;*/
    --light-gray: #2d2830;
    --dark-gray: #94a3b8;
    --nav-bg: rgba(13, 15, 24, 0.8);
    --nav-border: var(--accent-secondary);
    --cta-bg: linear-gradient( 45deg, rgba(0, 229, 255, 0.1), rgba(142, 45, 226, 0.1) );
    --grid-color: rgba(255, 255, 255, 0.05);
    --card-bg: #1a1d26;
    --card-border: rgba(255, 255, 255, 0.1);
    --primary-button-bg: var(--accent-color);
    --primary-button-text: var(--text-color);
    --warning-button-bg: #ffc107;
    --icon-color: #ffffff;
    /* Messaging Page Specific */
    --received-msg-bg: #212529;
    --sent-msg-bg: #1cdef5;
    --sent-msg-text: #000;
    --msg-metadata-color: #94a3b8;
    --input-bg: #212529;
    --input-border: #4a4d56;
    --active-thread-bg: #212529;
    --success-color: #28a745;
    --success-hover: #218838;
    --info-color: #00e5ff;
    --info-hover: #00c0e0;
    /* Scrollbar colors for dark mode */
    --scrollbar-track: #1a1d26;
    --scrollbar-thumb: #495057;

    --sm-color1: #21d4fd;
    --sm-color2: #7a5cff;
}


/* ========================================================================
              General Styles
         ======================================================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.5s ease, color 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
    position: relative;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Orbitron', sans-serif;
    color: var(--heading-color);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    transition: color 0.5s ease;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

    a:hover {
        color: var(--accent-secondary);
    }

/* ========================================================================
              Login Page Specific Styles
              ======================================================================== */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .login-header .logo {
        font-family: 'Orbitron', sans-serif;
        font-size: 2rem;
        font-weight: 700;
        text-transform: uppercase;
        background: var(--gradient-text);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        margin-bottom: 1rem;
        letter-spacing: 0.1rem;
    }

    .login-header h2 {
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--heading-color);
        margin-bottom: 0.5rem;
    }

    .login-header p {
        color: var(--dark-gray);
        font-size: 1rem;
    }

.login-form-container {
    width: 100%;
    text-align: center;
}

.form-step {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

    .form-step.active {
        display: block;
    }

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

    .form-group p {
        color: var(--dark-gray);
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

.input-with-icon {
    position: relative;
}

    .input-with-icon input {
        width: 100%;
        padding: 0.75rem 1rem 0.75rem 3rem;
        border-radius: 0.5rem;
        border: 1px solid var(--input-border);
        background-color: var(--input-bg);
        color: var(--text-color);
        font-size: 1rem;
        font-family: 'Poppins', sans-serif;
        transition: border-color 0.3s ease, background-color 0.3s ease;
    }

        .input-with-icon input:focus {
            outline: none;
            border-color: var(--accent-color);
        }

    .input-with-icon .input-icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--dark-gray);
        pointer-events: none;
    }

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.button-full-width {
    width: 100%;
}

.button-primary {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    background: var(--gradient-main);
    color: var(--primary-button-text);
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(74, 0, 224, 0.2);
    transition: all 0.3s ease;
}

    .button-primary:hover {
        opacity: 0.9;
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(74, 0, 224, 0.3);
    }

.button-secondary {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    background-color: var(--secondary-button-bg);
    color: var(--secondary-button-text);
    border-radius: 0.5rem;
    border: 1px solid var(--input-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

    .button-secondary:hover {
        background-color: #e0e0e0;
    }

body.dark-mode .button-secondary {
    border-color: var(--input-border);
}

    body.dark-mode .button-secondary:hover {
        background-color: #444;
    }

.footer-text {
    margin-top: 2rem;
    color: var(--dark-gray);
    font-size: 0.8rem;
    text-align: center;
}

.message-box {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    padding: 15px 30px;
    border-radius: 8px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

    .message-box.visible {
        opacity: 1;
        visibility: visible;
    }

.theme-toggle-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--heading-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: color 0.3s ease, background-color 0.3s ease;
}

    #theme-toggle:hover {
        background-color: var(--light-gray);
    }

body.dark-mode #theme-toggle {
    color: var(--accent-color);
}

    body.dark-mode #theme-toggle:hover {
        background-color: #1a1d26;
    }

.is-invalid {
    border-color: #dc3545 !important;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}
/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-50px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}
/* ================================================================================
Toast Notification CSS (Standalone)
================================================================================ */

.toast-container {
    position: fixed;
    right: 1.5rem;
    z-index: 1055;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast-container-bottom {
    bottom: 1.5rem;
}

.toast-container-top {
    top: 1.5rem;
}

.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    color: #fff;
    min-width: 250px;
    max-width: 350px;
    opacity: 0;
    transform: translateY(20px);
    animation: toast-fade-in 0.5s forwards;
}

    .toast.toast-visible {
        opacity: 1;
        transform: translateY(0);
    }

    .toast.toast-hidden {
        animation: toast-fade-out 0.5s forwards;
    }

.toast-body {
    font-weight: 500;
    font-size: 0.9rem;
    padding-right: 1rem;
}

.toast-close-button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

    .toast-close-button:hover {
        opacity: 1;
    }

/* Toast Types - Using variables from your site.css */
.toast-success {
    background-color: var(--success-color);
}

.toast-error {
    background-color: var(--danger-color);
}

.toast-info {
    background-color: var(--info-color);
}

/* Animations for showing and hiding the toast */
@keyframes toast-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-fade-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Drop-in spinner ring */
#spinner,
.smugme-spinner {
    width: 3rem;
    height: 3rem;
    border: .25rem solid rgba(0,0,0,.15);
    border-right-color: currentColor; /* visible segment */
    border-radius: 50%;
    animation: smugme-spin .75s linear infinite;
}

@keyframes smugme-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Respect reduced motion (optional) */
@media (prefers-reduced-motion: reduce) {
    #spinner, .smugme-spinner {
        animation: none;
    }
}

.spinner-overlay {
    position: fixed; /* Position relative to the viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid; /* Easiest way to center the child container */
    place-items: center;
    background-color: rgba(255, 255, 255, 0.5); /* Optional: dim the background */
    z-index: 9999; /* Ensure it's on top of other content */
}

/* The container now just uses flexbox to align items side-by-side */
.spinner-container {
    display: flex;
    align-items: center; /* Vertically aligns the 'S' and the dots */
    justify-content: center; /* Horizontally centers the whole group */
}

/* The 'S' character element */
.spinner-s {
    animation: spin 1.5s linear infinite;
    font-size: 40px;
    font-weight: bold;
    color: var(--primary-color);
    font-family: sans-serif;
}

/* Container for the dots */
.dots-container {
    margin-left: 8px; /* Adds a little space next to the 'S' */
}

/* Styling for each dot */
.dot {
    display: inline-block; /* Allows dots to sit side-by-side */
    width: 8px;
    height: 8px;
    margin-left: 4px;
    background-color: var(--primary-color);
    border-radius: 50%; /* Makes them circular */
    animation: bounce 1.4s infinite ease-in-out both;
}

    /* Animation delay for the wave effect */
    .dot:nth-child(2) {
        animation-delay: -0.16s;
    }

    .dot:nth-child(3) {
        animation-delay: -0.32s;
    }

/* The 'S' spin animation remains the same */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* A 'bounce' animation for the dots */
@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}