﻿/* ===============================================================
   GLOBAL DATE RANGE MODAL (v4)
   Enterprise Glass System — gdr-* namespace (no conflicts)
   =============================================================== */

/* -------- TOKENS -------- */
:root {
    --gdr-surface: #ffffff;
    --gdr-surface-alt: #f9fafb;
    --gdr-border: rgba(15, 23, 42, 0.12);
    --gdr-border-strong: rgba(15, 23, 42, 0.18);
    --gdr-text: #0f172a;
    --gdr-muted: #6b7280;
    --gdr-primary: #2563eb;
    --gdr-primary-hover: #1e4fc7;
    --gdr-radius: 14px;
    --gdr-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}

/* -------- OVERLAY -------- */
.gdr-overlay {
    display: none; /* JS toggles to flex */
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    animation: gdr-fade-in 0.2s ease-out;
}

/* -------- MODAL -------- */
.gdr-modal {
    width: 380px;
    max-width: 90%;
    background: var(--gdr-surface);
    border: 1px solid var(--gdr-border);
    border-radius: var(--gdr-radius);
    box-shadow: var(--gdr-shadow);
    display: flex;
    flex-direction: column;
    animation: gdr-scale-in 0.18s ease-out;
}

/* -------- HEADER -------- */
.gdr-header {
    padding: 1.1rem 1.3rem;
    border-bottom: 1px solid var(--gdr-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gdr-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gdr-text);
}

.gdr-close {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--gdr-muted);
    padding: 0.2rem;
}

    .gdr-close:hover {
        color: var(--gdr-text);
    }

/* -------- BODY -------- */
.gdr-body {
    padding: 1.4rem 1.3rem;
    display: grid;
    gap: 1.2rem;
}

.gdr-input-group label {
    font-size: 0.85rem;
    color: var(--gdr-muted);
    margin-bottom: 0.25rem;
    display: block;
}

.gdr-input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--gdr-border);
    background: var(--gdr-surface-alt);
    font-size: 0.9rem;
    color: var(--gdr-text);
}

    .gdr-input:focus {
        outline: 2px solid var(--gdr-primary);
        border-color: var(--gdr-primary);
    }

/* -------- FOOTER -------- */
.gdr-actions {
    padding: 1rem 1.3rem;
    border-top: 1px solid var(--gdr-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
}

.gdr-btn-primary {
    padding: 0.55rem 1rem;
    border-radius: 8px;
    background: var(--gdr-primary);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

    .gdr-btn-primary:hover {
        background: var(--gdr-primary-hover);
    }

.gdr-btn-secondary {
    padding: 0.55rem 1rem;
    border-radius: 8px;
    background: var(--gdr-surface-alt);
    border: 1px solid var(--gdr-border);
    color: var(--gdr-text);
    cursor: pointer;
}

    .gdr-btn-secondary:hover {
        background: var(--gdr-surface);
    }

/* -------- ANIMATIONS -------- */
@keyframes gdr-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes gdr-scale-in {
    from {
        transform: scale(0.92);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}


/* ================================
   QUICK RANGE PRESETS
   ================================ */
.gdr-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.gdr-preset-btn {
    padding: 0.45rem 0.5rem;
    background: var(--gdr-surface-alt);
    border: 1px solid var(--gdr-border);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--gdr-text);
    cursor: pointer;
}

    .gdr-preset-btn:hover {
        background: var(--gdr-surface);
    }

    .gdr-preset-btn.active {
        background: var(--gdr-primary);
        border-color: var(--gdr-primary);
        color: white;
    }
