/* ==========================================================================
   Sage Grabber - Premium Glassmorphic stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Color System */
    --bg-base: #060913;
    --bg-surface: rgba(13, 19, 33, 0.65);
    --bg-surface-opaque: #0f172a;
    --border-glow: rgba(6, 182, 212, 0.15);
    --border-light: rgba(255, 255, 255, 0.08);
    
    --primary: #06b6d4; /* Teal */
    --primary-rgb: 6, 182, 212;
    --secondary: #6366f1; /* Indigo */
    --accent: #d946ef; /* Magenta */
    
    --success: #10b981; /* Emerald */
    --success-rgb: 16, 185, 129;
    --warning: #f59e0b; /* Amber */
    --danger: #f43f5e; /* Rose */
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --gradient-primary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%);
    --gradient-glow: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
    --shadow-neon: 0 0 25px rgba(6, 182, 212, 0.25);
    
    /* Layout Rules */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-display: 'Outfit', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Ambient Background Lights */
body::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: #22d3ee;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5em;
    color: var(--text-primary);
}

/* Beautiful Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Glassmorphism Card styling */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.glass-card:hover {
    border-color: rgba(6, 182, 212, 0.25);
    box-shadow: 0 12px 40px 0 rgba(6, 182, 212, 0.08), 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Gaps and Grid Helpers */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Glowing Header Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(6, 182, 212, 0.1);
    color: var(--primary);
    border: 1px solid rgba(6, 182, 212, 0.2);
    margin-bottom: 1rem;
}

.badge.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.badge.badge-danger {
    background: rgba(244, 63, 94, 0.1);
    color: var(--danger);
    border-color: rgba(244, 63, 94, 0.2);
}

.badge.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.2);
}

/* Custom Interactive Forms */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: inline-block;
    transition: var(--transition-smooth);
}

.form-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
    font-family: var(--font-sans);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

.form-input[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Premium Button Designs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-smooth);
    font-family: var(--font-display);
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neon);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
}

/* Consent Page Elements */
.consent-box {
    max-width: 680px;
    margin: 2rem auto;
}

.telemetry-preview {
    background: rgba(15, 23, 42, 0.4);
    border: 1px dashed rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin: 1.5rem 0;
    font-size: 0.85rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1.5rem;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 0.25rem;
}

.preview-label {
    color: var(--text-secondary);
}

.preview-value {
    color: var(--primary);
    font-family: monospace;
    font-weight: 500;
}

/* Info Cards for Data Privacy */
.data-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    transition: var(--transition-smooth);
}

.data-item:hover {
    border-color: rgba(6, 182, 212, 0.15);
    background: rgba(15, 23, 42, 0.7);
}

.data-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.data-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.data-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Loader Widget */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(6, 182, 212, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Card */
.success-card {
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1rem;
    animation: scale-up 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scale-up {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.audit-id-badge {
    background: var(--bg-surface-opaque);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--primary);
    margin: 1.5rem auto;
    letter-spacing: 0.05em;
    max-width: 450px;
    word-break: break-all;
    box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.1);
}

/* Admin Dashboard layout */
.admin-navbar {
    background: rgba(13, 19, 33, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.nav-link.active, .nav-link:hover {
    color: var(--text-primary);
}

/* Dashboard Stats Strip */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-top: 0.5rem;
}

.stat-val span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Table styling for Reports list */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-top: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
    background: rgba(13, 19, 33, 0.3);
}

th {
    background: rgba(15, 23, 42, 0.7);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    vertical-align: middle;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.text-white {
    color: var(--text-primary) !important;
}

/* Utility Copy Button */
.btn-copy {
    background: rgba(6, 182, 212, 0.1);
    color: var(--primary);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-copy:hover {
    background: var(--primary);
    color: white;
}

/* Custom Modals for report details */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-surface-opaque);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px);
    transition: var(--transition-smooth);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: var(--danger);
}

/* Admin Tabs Configuration */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fade-in 0.4s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom micro-notification system */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-surface-opaque);
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    transform: translateY(150%);
    transition: var(--transition-smooth);
}

.toast.active {
    transform: translateY(0);
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .glass-card {
        padding: 1.5rem;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
    }
}
