/* Colors & Design Tokens */
:root {
    --bg-dark: #080b11;
    --bg-dark-card: rgba(17, 24, 39, 0.65);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.16);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --color-primary: #10b981; /* Emerald Neon */
    --color-primary-rgb: 16, 185, 129;
    --color-warning: #f59e0b; /* Amber */
    --color-danger: #ef4444; /* Rose */
    --color-info: #3b82f6; /* Blue */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base resets & styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Premium Background & Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3e%3cfilter id='noiseFilter'%3e%3cfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3e%3c/filter%3e%3crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3e%3c/svg%3e");
    opacity: 0.02;
    pointer-events: none;
    z-index: 999;
}

.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    filter: blur(140px);
    opacity: 0.55;
    pointer-events: none;
}

.g1, .g2, .g3 {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
}

.g1 {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -100px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(0,0,0,0) 70%);
}

.g2 {
    width: 500px;
    height: 500px;
    bottom: -100px;
    left: -100px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(0,0,0,0) 70%);
}

.g3 {
    width: 400px;
    height: 400px;
    top: 30%;
    left: 40%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.08) 0%, rgba(0,0,0,0) 70%);
}

/* Glassmorphism Effect */
.glass-effect {
    background: var(--bg-dark-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    transition: var(--transition-smooth);
}

.glass-effect:hover {
    border-color: var(--border-glass-hover);
    box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px -2px rgba(16, 185, 129, 0.05);
}

/* Header & Navigation */
.app-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(8, 11, 17, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.logo-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-primary);
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.radar-ping {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    border: 2px solid var(--color-primary);
    animation: logo-ping 2s infinite ease-out;
}

@keyframes logo-ping {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, #a7f3d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.nav-link:hover, .nav-link.active {
    color: var(--color-primary);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-outline-primary {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-outline-primary:hover {
    background: rgba(16, 185, 129, 0.08);
}

.btn-outline-success {
    background: rgba(16, 185, 129, 0.05);
    color: var(--color-primary);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 8px;
}

.btn-icon-only {
    width: 44px;
    height: 44px;
    padding: 0;
}

/* Hero Section */
.hero-section {
    max-width: 1000px;
    margin: 4rem auto 2rem auto;
    text-align: center;
    padding: 0 2rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #34d399 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Dashboard Grid */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.card {
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.card-radar {
    grid-column: span 5;
}

.card-details {
    grid-column: span 7;
}

.card-insights {
    grid-column: span 12;
}

.card-integrations, .card-alerts {
    grid-column: span 6;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-primary);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse {
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Radar Screen Simulation */
.radar-visualization-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    flex: 1;
}

.radar-screen {
    position: relative;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, rgba(8, 11, 17, 0.9) 100%);
    border: 2px solid rgba(16, 185, 129, 0.25);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.1) inset, 0 0 15px rgba(16, 185, 129, 0.05);
}

.radar-sweep {
    position: absolute;
    width: 50%;
    height: 50%;
    background: linear-gradient(45deg, rgba(16, 185, 129, 0.35) 0%, rgba(16, 185, 129, 0) 60%);
    transform-origin: bottom right;
    top: 0;
    left: 0;
    animation: radar-sweep-anim 4s linear infinite;
    z-index: 1;
}

@keyframes radar-sweep-anim {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.radar-circle {
    position: absolute;
    border: 1px dashed rgba(16, 185, 129, 0.15);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.rc1 { width: 33%; height: 33%; }
.rc2 { width: 66%; height: 66%; }
.rc3 { width: 100%; height: 100%; }

.radar-crosshair-h, .radar-crosshair-v {
    position: absolute;
    background: rgba(16, 185, 129, 0.08);
}

.radar-crosshair-h {
    width: 100%;
    height: 1px;
    top: 50%;
    left: 0;
}

.radar-crosshair-v {
    width: 1px;
    height: 100%;
    left: 50%;
    top: 0;
}

/* Blips */
.blip {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    z-index: 2;
    cursor: pointer;
    box-shadow: 0 0 10px currentColor;
    animation: blip-glow 1.5s infinite alternate;
}

@keyframes blip-glow {
    0% { transform: scale(0.9); box-shadow: 0 0 4px currentColor; }
    100% { transform: scale(1.3); box-shadow: 0 0 12px currentColor; }
}

.blip-danger { background-color: var(--color-danger); color: var(--color-danger); }
.blip-warning { background-color: var(--color-warning); color: var(--color-warning); }
.blip-info { background-color: var(--color-info); color: var(--color-info); }

.blip[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(8, 11, 17, 0.95);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.blip:hover::before {
    opacity: 1;
}

.radar-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-glass);
    padding-top: 1.5rem;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

/* Cost Detail Tables */
.table-container {
    overflow-x: auto;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.audit-table th {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.audit-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.95rem;
}

.audit-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-success { background-color: var(--color-primary); }
.dot-warning { background-color: var(--color-warning); }
.dot-danger { background-color: var(--color-danger); }

/* Anomaly Insights */
.insights-list {
    display: grid;
    gap: 1rem;
}

.insight-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition-smooth);
}

.insight-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.insight-icon-container {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-bg-danger { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); }
.icon-bg-warning { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); }
.icon-bg-info { background: rgba(59, 130, 246, 0.1); color: var(--color-info); }

.insight-meta {
    flex: 1;
    margin-left: 1.25rem;
}

.insight-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

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

.insight-action-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.saving-highlight {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
}

.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-success { color: var(--color-primary); }

/* Integrations Grid */
.section-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

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

.integration-item {
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.int-info h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.int-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Form Styling */
.alert-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-family: var(--font-body);
}

.input-range-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.form-range {
    flex: 1;
    accent-color: var(--color-primary);
}

.range-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-primary);
    width: 60px;
    text-align: right;
}

.checkbox-group {
    flex-direction: row !important;
    align-items: center;
    gap: 0.75rem !important;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

.full-width {
    width: 100%;
}

/* Pricing Grid */
.pricing-section {
    margin-top: 6rem;
    margin-bottom: 6rem;
    text-align: center;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-card {
    border-radius: 28px;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.pricing-card-popular {
    border-color: rgba(16, 185, 129, 0.45);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, rgba(17, 24, 39, 0.8) 100%);
}

.card-highlight {
    position: absolute;
    top: -15px;
    background: var(--color-primary);
    color: #fff;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
}

.pricing-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.price {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
}

.price span {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.pricing-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
    width: 100%;
    text-align: left;
    padding: 0 1rem;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.pricing-features li::before {
    content: "✓";
    color: var(--color-primary);
    font-weight: bold;
}

/* Footer styling */
.app-footer {
    border-top: 1px solid var(--border-glass);
    padding: 2.5rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Light theme overrides */
body.light-theme {
    --bg-dark: #f8fafc;
    --bg-dark-card: rgba(255, 255, 255, 0.8);
    --border-glass: rgba(0, 0, 0, 0.06);
    --border-glass-hover: rgba(0, 0, 0, 0.12);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
}

body.light-theme .logo-text {
    background: linear-gradient(135deg, #0f172a 0%, #10b981 100%);
    -webkit-background-clip: text;
}

body.light-theme .btn-secondary {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.light-theme .pricing-card-popular {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.04) 0%, rgba(255, 255, 255, 0.9) 100%);
}
