/* Avlyia Sense Premium Theme Design System */

:root {
    --bg-dark: #07050f;
    --bg-panel: rgba(255, 255, 255, 0.02);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f1f0f7;
    --text-secondary: #a3a1b3;
    --text-muted: #6e6b80;
    
    /* Harmonious Curated Colors */
    --accent-cyan: #00f2fe;
    --accent-indigo: #4facfe;
    --accent-purple: #7f56da;
    --accent-magenta: #f857a6;
    --accent-rose: #ff5858;
    --accent-green: #00ff87;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'Fira Code', monospace;
    
    --glow-cyan: 0 0 15px rgba(0, 242, 254, 0.4);
    --glow-purple: 0 0 15px rgba(127, 86, 218, 0.4);
    --glow-magenta: 0 0 15px rgba(248, 87, 166, 0.4);
    --glow-green: 0 0 15px rgba(0, 255, 135, 0.4);
}

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

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

/* Background Mesh & Blobs */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #110d24 0%, #06040b 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    animation: pulse 12s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--accent-purple);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--accent-cyan);
    animation-delay: 3s;
}

.blob-3 {
    top: 30%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: var(--accent-magenta);
    opacity: 0.08;
    animation-delay: 6s;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(5%, 5%); }
}

/* Page Layout Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-content h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-content h1 span {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-indigo) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Mode Selector Switch */
.mode-selector-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
}

.mode-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s;
}

.mode-label.active {
    color: var(--accent-cyan);
    text-shadow: var(--glow-cyan);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-primary);
    transition: .3s;
}

input:checked + .slider {
    background-color: var(--accent-purple);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 380px 1fr 340px;
    gap: 1.5rem;
    flex-grow: 1;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Glassmorphic Panels */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: border-color 0.3s, transform 0.3s;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Badge States */
.badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.08);
}

#mode-badge {
    background: rgba(127, 86, 218, 0.15);
    color: var(--accent-purple);
    border-color: rgba(127, 86, 218, 0.3);
}

.live-indicator {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.3);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

.pulsing {
    animation: indicator-pulse 2s infinite alternate ease-in-out;
}

@keyframes indicator-pulse {
    0% { opacity: 0.6; box-shadow: 0 0 0 rgba(0, 242, 254, 0); }
    100% { opacity: 1; box-shadow: 0 0 8px rgba(0, 242, 254, 0.4); }
}

/* Control Elements */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.label-val-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-value {
    font-family: var(--font-code);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-cyan);
}

.slider-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: -0.25rem;
}

/* Inputs & Form Controls */
input[type="text"], input[type="url"] {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.3s;
}

input[type="text"]:focus, input[type="url"]:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
    background: rgba(255, 255, 255, 0.05);
}

/* Range Slider Custom Styling */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-cyan);
    cursor: pointer;
    box-shadow: var(--glow-cyan);
    transition: transform 0.1s, background-color 0.3s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Action Board & Buttons */
.action-board {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

.action-board h3 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    padding: 0.8rem;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(1px);
}

.action-btn svg {
    transition: transform 0.3s;
}

.action-btn:hover svg {
    transform: rotate(15deg) scale(1.1);
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-indigo) 100%);
    border: none;
    box-shadow: var(--glow-purple);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #8d66ea 0%, #5eb2ff 100%);
    box-shadow: 0 0 20px rgba(127, 86, 218, 0.6);
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: all 0.3s;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-trend {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-trend.positive {
    color: var(--accent-green);
    text-shadow: 0 0 8px rgba(0, 255, 135, 0.2);
}

.stat-trend.negative {
    color: var(--accent-rose);
    text-shadow: 0 0 8px rgba(255, 88, 88, 0.2);
}

.stat-trend.neutral {
    color: var(--accent-indigo);
}

/* Graph Container */
.chart-container {
    flex-grow: 1;
    min-height: 280px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Reward Alert Notification Box */
.reward-alert-box {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(135deg, rgba(248, 87, 166, 0.08) 0%, rgba(127, 86, 218, 0.08) 100%);
    border: 1px solid rgba(248, 87, 166, 0.2);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(10px);
    animation: slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s;
}

@keyframes slide-up {
    0% { transform: translateY(15px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.reward-icon-container {
    font-size: 2.25rem;
    background: rgba(255, 255, 255, 0.05);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--glow-magenta);
    animation: reward-float 3s infinite alternate ease-in-out;
}

@keyframes reward-float {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-5px) rotate(5deg); }
}

.reward-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.reward-details h4 {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--accent-magenta);
    letter-spacing: 1px;
}

.reward-details p {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.reward-mag-badge {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    color: var(--accent-cyan);
}

.reward-msg {
    font-size: 0.8rem !important;
    color: var(--text-secondary) !important;
    font-style: italic;
}

/* Event Log Console Panel */
.console-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.clear-btn {
    background: transparent;
    border: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s;
}

.clear-btn:hover {
    color: var(--accent-rose);
    background: rgba(255, 88, 88, 0.08);
}

.console-body {
    background: rgba(5, 4, 12, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    flex-grow: 1;
    font-family: var(--font-code);
    font-size: 0.8rem;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 600px;
}

/* Console Entries */
.log-entry {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    word-break: break-all;
    border-left: 2px solid var(--text-muted);
    padding-left: 0.5rem;
}

.log-entry.system {
    border-color: var(--accent-purple);
}

.log-entry.request {
    border-color: var(--accent-indigo);
}

.log-entry.response {
    border-color: var(--accent-green);
}

.log-entry.error {
    border-color: var(--accent-rose);
}

.log-entry .timestamp {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.log-entry .message {
    color: var(--text-primary);
}

.log-entry pre {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    padding: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #e5c07b;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Utilities */
.hidden {
    display: none !important;
}

.api-fields {
    background: rgba(255,255,255,0.01);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: slide-down 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-down {
    0% { transform: translateY(-10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
