/* ============================================================
   Dashboard Shared CSS — complements Tailwind
   ============================================================ */

/* ── Custom Properties ── */
:root {
    --color-primary:    #DA39FA;
    --color-secondary:  #6B4AE4;
    --color-bg:         #08091D;
    --color-glass:      rgba(0, 0, 0, 0.6);
    --color-glass-border: rgba(255, 255, 255, 0.5);
    --color-text:       #ffffff;
    --color-text-muted: rgba(255, 255, 255, 0.5);
    --color-border:     rgba(255, 255, 255, 0.1);
}

/* ── Base ── */
html, body {
    min-height: 100%;
}
body {
    background-color: var(--color-bg);
    background-image: url('/assets/images/gradient-bg.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ── Glass morphism ── */
.glass {
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
}

.glass-light {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ── Typography ── */
.gradient-text { color: var(--color-primary); }

/* ── Buttons ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 64px;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-secondary);
    color: #fff;
    border: none;
    border-radius: 64px;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}
.btn-secondary:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Tool Card Grid ── */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
@media (max-width: 1024px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .tool-grid { grid-template-columns: 1fr; } }

.tool-card {
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: 24px;
    padding: 2rem;
    transition: transform 0.3s ease, background 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}
.tool-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.08);
}

/* ── Usage Badge ── */
#usage-badge {
    transition: color 0.3s;
}
#usage-badge.usage-warning { color: #fbbf24; }
#usage-badge.usage-depleted { color: #f87171; }

/* ── Email Modal ── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    padding: 2.5rem;
    animation: modalFadeIn 0.3s ease-out forwards;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes modalFadeOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to   { opacity: 0; transform: scale(0.95) translateY(10px); }
}

/* ── Limit-reached overlay ── */
#limit-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
#limit-overlay.hidden { display: none; }

/* ── Loading spinner ── */
.dash-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: #DA39FA;
    border-radius: 50%;
    animation: dashSpin 0.8s linear infinite;
    vertical-align: middle;
}
@keyframes dashSpin { to { transform: rotate(360deg); } }

/* ── Animations ── */
.animate-in {
    animation: slideIn 0.6s ease-out forwards;
    opacity: 0;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Form inputs shared ── */
.dash-input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
}
.dash-input::placeholder { color: rgba(255,255,255,0.3); }
.dash-input:focus {
    outline: none;
    border-color: rgba(107,74,228,0.5);
    background: rgba(255,255,255,0.1);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
