/* Reset & Base */
:root {
    --primary: #22c55e;
    /* softer green - main accent */
    --primary-dark: #16a34a;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --bg-soft: #f3f4f6;
    --card-bg: #ffffff;
    --success: #2dd4bf;
    /* softer cyan for status */
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: var(--text-dark);
    min-height: 100vh;
    
    /* Dotted pattern using radial gradient */
    background-image: radial-gradient(#cbd5e1 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    height: 100vh;
    margin: 0;
}

/* Header */
.saber-title {
    color: #15803d;
    letter-spacing: -0.5px;
    line-height: 1.05;
}

header p {
    color: var(--text-muted);
}

/* Card */
.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.04),
        0 4px 8px -4px rgba(0, 0, 0, 0.03);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.login-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.05);
}

/* Inputs */
.input-friendly {
    border-color: #d1d5db !important;
    border-radius: 8px !important;
    background: var(--bg-soft);

    height: 75px;
    /* 🔥 makes input visibly taller */
    font-size: 1.2rem;
    /* 🔥 bigger typed text */
    padding: 1.5rem 1rem 0.5rem 1rem !important;
    /* adjusts for floating label */

    transition: border-color 0.2s ease;
}

.input-friendly:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15) !important;
}

.form-floating>label {
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    font-weight: 500;
}

/* Button */
.btn-primary {
    /*background-color: var(--primary);*/
    background: linear-gradient(135deg,
            #16a34a,
            /* slightly darker */
            #22c55e,
            /* your original color */
            #4ade80
            /* slightly lighter */
        );
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
    transition: all 0.28s ease;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(34, 197, 94, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    background-color: #16a34a;
}

/* Status indicator */
.status-dot {
    height: 12px;
    width: 12px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.4);
    flex-shrink: 0;
}

/* Preloader */
.preloader {
    position: fixed;
    inset: 0;
    background: rgba(243, 244, 246, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Responsive tweaks */
@media (max-width: 576px) {
    .login-card {
        border-radius: 12px;
    }

    .card-body {
        padding: 1.375rem 1rem !important;
    }
}


/* Popup overlay */
.lot-popup-overlay {
    position: fixed;
    inset: 0;
    /* top:0; right:0; bottom:0; left:0; */
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    /* semi-transparent background */
    z-index: 1050;
    /* above everything else */
}

/* Popup modal box */
.lot-popup-modal {
    background-color: var(--card-bg);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-height: 80vh;
    overflow-y: auto;
}

/* List inside popup */
.lot-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.lot-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background-color: var(--bg-soft);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.lot-item:hover {
    background-color: var(--primary);
    color: #fff;
}

/* Close button */
.btn-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
}

/* Initially hidden */
.d-none {
    display: none !important;
}

#roleButtons button {
    width: 100%;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#roleButtons button:hover {
    transform: translateY(-2px);

}

.btn-delete {
    background-image: linear-gradient(135deg, #1a1616ab, #000000) !important;
    background-color: transparent !important;
    /* IMPORTANT */
    color: #fff !important;

    border: none;
    border-radius: 8px;
    font-size: 1rem;
    padding: 0.75rem 1rem;

    transition: all 0.28s ease;
}

/* active state */
.btn-delete:active {
    transform: translateY(0);
    background-image: linear-gradient(135deg, #0f0f0f, #000000) !important;
}

.btn-delete:hover {
    background-color: #0a0303;
    /* slightly darker on hover */
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(248, 113, 113, 0.4);
    color: white;
}

.btn-delete:active {
    transform: translateY(0);
    background-color: #ef4444;
    /* active click state */
}

/* Softer Add Button */
.btn-add {
    background-image: linear-gradient(135deg, #14532d, #16a34a, #22c55e) !important;
    background-color: transparent !important;

    color: #ffffff !important;

    border: none;
    border-radius: 8px;
    font-size: 1rem;
    padding: 0.75rem 1rem;

    transition: all 0.28s ease;
}

.btn-add:hover {
    background-color: #2a4a38;
    /* slightly darker green on hover */
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(37, 134, 72, 0.3);
    color: white;
}

.btn-add:active {
    transform: translateY(0);
    background-color: #22c55e;
    /* active click state */
}

#rolePopup.lot-popup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.35);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    z-index: 1050;
}

#rolePopup .lot-popup-modal {
    background: rgba(255, 255, 255, 0.75);

    /* REMOVE sharp edge */
    border: none;

    /* softer shape */
    border-radius: 18px;

    /* softer depth instead of harsh shadow */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);

    /* glass effect blending */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    max-width: 500px;
    width: 90%;
    padding: 1.5rem;

    max-height: 80vh;
    overflow-y: auto;
}

#rolePopup .lot-popup-modal {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.95),
            rgba(245, 245, 245, 0.85));
}


#closeRolePopup {
    background-color: #000000;
    color: #ffffff;

    border: none;
    border-radius: 8px;

    font-size: 1rem;
    padding: 0.6rem 1.2rem;

    transition: all 0.25s ease;
}

.battery-icon {
    color: var(--primary);
    font-size: 5rem;
    /* adjust size as needed */
    line-height: 1;
    display: flex;
    align-items: center;
    position: relative;
    /* enable top adjustment */
    top: -0.5rem;
    /* move icon slightly up */
}


/* Floating balls container */
#floatingBallsContainer {
    position: fixed;
    inset: 0;
    /* top:0; right:0; bottom:0; left:0; */
    overflow: hidden;
    z-index: 0;
    /* behind login card */
}

/* Ball styles */
.floating-ball {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    pointer-events: none;
    /* don't block clicks */
    animation: float 10s linear infinite;
}

/* Optional floating animation */
@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0);
    }
}

/* Ensure login card is above balls */
.login-card {
    position: relative;
    z-index: 10;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 2s forwards;
}


/* Hide floating balls on small screens (mobile) */
@media (max-width: 768px) {
    #floatingBallsContainer {
        display: none;
    }

    body {
        /* Dotted pattern using radial gradient */
        background-image: radial-gradient(#cbd5e1 1.5px, transparent 1.5px);
        background-size: 24px 24px;
        height: 100vh;
        margin: 0;
    }
}

/*For small mobel screens*/

@media (max-width: 768px) {
    body {
        scroll-behavior: smooth;
    }
}

header {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 2s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 2;
        transform: translateY(0);
    }
}


/* Container for the icon and input */
.icon-field {
    position: relative;
}

/* The actual icon styling */
.field-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d; /* Muted grey */
    z-index: 10;
    transition: color 0.2s ease-in-out;
    pointer-events: none; /* Allows clicks to pass through to the input */
}

/* Adjusting the input and label padding to clear the icon */
.icon-field .form-control {
    padding-left: 45px !important;
}

.icon-field label {
    padding-left: 45px !important;
}

/* Active State: Turns icon green when user clicks the field */
.icon-field .form-control:focus ~ .field-icon {
    color: #10b981; /* Your saberBMS Green */
}

/* Ensure the label also moves correctly when floating */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(.85) translateY(-0.5rem) translateX(0.15rem);
}