/* Root Variables for Light and Dark Mode */
:root {
    --background-color: #ffffff;
    --text-color: #333333;
    --card-bg: #f8f9fa;
    --footer-bg: #f1f1f1;
    --link-color: #0066cc;
    --link-hover-color: #004499;
    --accent-color: #5b79f8;
    --gradient-start: #5b79f8;
    --gradient-end: #6875f5;
    --card-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] {
    --background-color: #121212;
    --text-color: #e4e4e4;
    --card-bg: #1e1e1e;
    --footer-bg: #1f1f1f;
    --link-color: #66b2ff;
    --link-hover-color: #3399ff;
    --accent-color: #72aaff;
    --gradient-start: #3949ab;
    --gradient-end: #5c84f7;
    --card-shadow: 0px 5px 15px rgba(0, 0, 0, 0.4);
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.25s ease;
}

a:hover {
    color: var(--link-hover-color);
}

.card {
    background-color: var(--card-bg);
    border: none;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

footer {
    background-color: var(--footer-bg);
    text-align: center;
    padding: 1rem;
}

.icon {
    font-size: 1.2rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.input-group-text .icon {
    color: #6c757d;
}
[data-bs-theme="dark"] .input-group-text .icon {
    color: #adb5bd;
}

/* Ensure subtitle is visible in both light and dark modes */
.login-subtitle {
    color: var(--text-color); /* Default for light mode */
    opacity: 0.9; /* Subtle transparency to blend nicely */
    font-size: 1rem;
    transition: color 0.3s ease, opacity 0.3s ease;
}

[data-bs-theme="dark"] .login-subtitle {
    color: #ccd6f6 !important; /* Ensure visibility with a lighter color in dark mode */
    opacity: 1; /* Full opacity for better contrast */
}

/* Stylish Login Enhancements */
.background-gradient {
    background: linear-gradient(to bottom right, var(--gradient-start), var(--gradient-end));
    color: var(--text-color);
    background-attachment: fixed;
}

.login-heading {
    color: var(--accent-color);
}

/* Gradient Button */
.btn-gradient {
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
    color: #fff;
    font-weight: bold;
    border: none;
    transition: background 0.3s ease, transform 0.2s ease;
}

.btn-gradient:hover {
    background: linear-gradient(45deg, var(--gradient-end), var(--gradient-start));
    transform: scale(1.02);
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}

/* Animated Card */
.animated-card {
    animation: fadeIn 1s ease-out;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.text-accent {
    color: var(--link-color);
}

/* Footer Text */
footer p {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* Label Styling */
form label {
    font-weight: 500;
    font-size: 0.925rem;
    color: #6c757d; /* Muted Bootstrap gray */
    margin-bottom: 0.4rem;
}

    /* Remember-me checkbox label: stay readable on both light and dark cards
   (the muted gray above is too low-contrast on the dark card background) */
.form-check-label {
    color: var(--text-color);
}

/* Input Styling */
form .form-control {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 1rem;
    padding: 0.75rem;
    transition: all 0.3s ease-in-out;
}

/* Focus Effect */
form .form-control:focus {
    border-color: #5cb85c; /* Matches success button color */
    box-shadow: 0 0 0 0.2rem rgba(92, 184, 92, 0.25); /* Light green shadow */
}

/* Register Button Styling */
.btn-success {
    background-color: #5cb85c;
    border-color: #5cb85c;
    font-weight: 600;
    letter-spacing: 0.05rem; /* Slightly spaced letters */
}

.btn-success:hover {
    background-color: #4cae4c;
    border-color: #449d44;
}

/* OAuth buttons (2026-10-01). The icons size themselves (width and height attributes, 20 px), so a late or
 * missing stylesheet can no longer blow them up; these rules style the buttons, through CoreUI's button
 * variables so hover, focus and active stay consistent. Google's button follows its sign-in branding
 * guidelines: the official "G" on white with a #747775 border and #1F1F1F text, or on #131314 with a
 * #8E918F border and #E3E3E3 text in the dark theme, 40 px tall; hover lays an 8 % tint over it. */
.oauth-buttons .btn-oauth {
    --cui-btn-border-width: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 40px;
    font-weight: 500;
}

.oauth-buttons .btn-oauth-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
}

.oauth-buttons .btn-oauth-github {
    --cui-btn-bg: #24292f;
    --cui-btn-border-color: #24292f;
    --cui-btn-color: #ffffff;
    --cui-btn-hover-bg: #32383f;
    --cui-btn-hover-border-color: #32383f;
    --cui-btn-hover-color: #ffffff;
    --cui-btn-active-bg: #1b1f24;
    --cui-btn-active-border-color: #1b1f24;
    --cui-btn-active-color: #ffffff;
    --cui-btn-focus-shadow-rgb: 36, 41, 47;
}

.oauth-buttons .btn-oauth-google {
    --cui-btn-bg: #ffffff;
    --cui-btn-border-color: #747775;
    --cui-btn-color: #1f1f1f;
    --cui-btn-hover-bg: #eeeeee;
    --cui-btn-hover-border-color: #747775;
    --cui-btn-hover-color: #1f1f1f;
    --cui-btn-active-bg: #e3e3e3;
    --cui-btn-active-border-color: #747775;
    --cui-btn-active-color: #1f1f1f;
    --cui-btn-focus-shadow-rgb: 116, 119, 117;
}

/* Dark theme: the GitHub button keeps an edge on the dark page; Google's switches to its dark variant. */
[data-bs-theme="dark"] .oauth-buttons .btn-oauth-github {
    --cui-btn-border-color: #3d444d;
    --cui-btn-hover-border-color: #4d555e;
    --cui-btn-active-border-color: #3d444d;
}

[data-bs-theme="dark"] .oauth-buttons .btn-oauth-google {
    --cui-btn-bg: #131314;
    --cui-btn-border-color: #8e918f;
    --cui-btn-color: #e3e3e3;
    --cui-btn-hover-bg: #242425;
    --cui-btn-hover-border-color: #8e918f;
    --cui-btn-hover-color: #e3e3e3;
    --cui-btn-active-bg: #2e2e30;
    --cui-btn-active-border-color: #8e918f;
    --cui-btn-active-color: #e3e3e3;
}

/* Toast container positioning */
.toast-container {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    z-index: 1050;
    padding: 0 15px;
}

/* Ensure toast appears above other content */
.toast-container .toast {
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    animation: slideInDown 0.4s ease-out;
}

/* Toast slide-in animation */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive toast width */
@media (max-width: 768px) {
    .toast-container {
        padding: 0 10px;
    }

    .toast-container .col-lg-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Ensure proper spacing from top on mobile */
@media (max-width: 576px) {
    .toast-container {
        top: 10px;
    }
}

