/* CSS Variables / Theme Configuration */
:root {
    --bg-dark: #0b0f19;
    --bg-panel: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    /* Curated Palette - HSL values for customization */
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.35);
    --accent-teal: #10b981;
    --accent-teal-glow: rgba(16, 185, 129, 0.35);
    
    --success-color: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger-color: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Base Styles */
* {
    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;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

/* Deep Space Radial Glowing Backgrounds */
.glass-bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-blue-glow) 0%, rgba(0,0,0,0) 70%);
    top: -100px;
    left: -100px;
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
    animation: floatGlow 15s ease-in-out infinite alternate;
}

.glass-bg-glow.secondary {
    background: radial-gradient(circle, var(--accent-teal-glow) 0%, rgba(0,0,0,0) 70%);
    bottom: -150px;
    right: -150px;
    top: auto;
    left: auto;
    animation: floatGlow 20s ease-in-out infinite alternate-reverse;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* App Container Layout */
.app-container {
    width: 100%;
    max-width: 1280px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 10;
}

/* Header Styles */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

.logo-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #60a5fa 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tagline {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-teal);
    box-shadow: 0 0 10px var(--accent-teal);
}

.status-dot.pulse {
    animation: statusPulse 1.8s infinite;
}

.status-dot.disconnected {
    background-color: var(--danger-color);
    box-shadow: 0 0 10px var(--danger-color);
}

@keyframes statusPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Dashboard Workspace Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
}

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

/* Glassmorphism Workspace Panels */
.workspace-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: var(--transition-smooth);
}

.workspace-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

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

.form-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Interactive Steps Cards */
.step-card {
    display: flex;
    gap: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 14px;
    transition: var(--transition-smooth);
}

.step-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.step-number {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.15);
    line-height: 1.2;
}

.step-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.step-content h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.step-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -0.4rem;
}

/* Microphone Speech Controls */
.voice-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.25rem;
}

textarea {
    width: 100%;
    min-height: 100px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    transition: var(--transition-smooth);
}

textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1e40af 100%);
    color: white;
    font-weight: 700;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

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

.btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
    border-radius: 12px;
}

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

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

.btn-secondary.recording {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    animation: buttonPulse 1.5s infinite alternate;
}

@keyframes buttonPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.02); }
}

.btn-tertiary {
    background: transparent;
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
    width: 100%;
    margin-top: 0.25rem;
}

.btn-tertiary:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.04);
}

/* Audio Waveform Animation */
.audio-wave {
    display: none;
    align-items: flex-end;
    gap: 3px;
    height: 24px;
}

.audio-wave.active {
    display: flex;
}

.audio-wave span {
    display: block;
    width: 3px;
    height: 4px;
    background-color: var(--danger-color);
    border-radius: 2px;
    animation: bounceAudio 0.8s infinite ease-in-out;
}

.audio-wave span:nth-child(2) { animation-delay: 0.15s; }
.audio-wave span:nth-child(3) { animation-delay: 0.3s; }
.audio-wave span:nth-child(4) { animation-delay: 0.45s; }
.audio-wave span:nth-child(5) { animation-delay: 0.1s; }

@keyframes bounceAudio {
    0%, 100% { height: 4px; }
    50% { height: 22px; }
}

/* Drag and Drop Zone */
.dropzone {
    width: 100%;
    min-height: 140px;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.03);
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.upload-icon {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
}

.dropzone-prompt .main-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.dropzone-prompt .sub-text {
    font-size: 0.75rem;
}

.browse-link {
    color: var(--accent-blue);
    text-decoration: underline;
    font-weight: 600;
}

.preview-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background-color: var(--bg-dark);
}

.preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: var(--transition-smooth);
}

.remove-btn:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.remove-btn svg {
    width: 16px;
    height: 16px;
}

.shortcut-actions {
    display: flex;
    justify-content: space-between;
}

/* Spinner Loader */
.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    border-top-color: white;
    animation: spinLoader 0.8s linear infinite;
    margin-left: 0.5rem;
}

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

/* Right Panel: Results Views */
.results-panel {
    position: relative;
    min-height: 500px;
}

/* Empty State Styles */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex-grow: 1;
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
}

.empty-icon {
    width: 64px;
    height: 64px;
    color: rgba(255, 255, 255, 0.06);
    border: 1.5px dashed rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.01);
}

.empty-icon svg {
    width: 32px;
    height: 32px;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 280px;
}

/* Error State */
.error-panel {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 1.25rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.error-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--danger-color);
}

.error-icon {
    width: 20px;
    height: 20px;
}

.error-panel h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
}

.error-panel p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Output Display Dashboard Content */
.results-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeUp 0.5s ease-out forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Verdict Banner */
.verdict-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-radius: 14px;
    border: 1px solid;
    position: relative;
    overflow: hidden;
}

.verdict-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

/* approved styles */
.verdict-card.approved {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.verdict-card.approved::before {
    background-color: var(--success-color);
}

/* rejected styles */
.verdict-card.rejected {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.verdict-card.rejected::before {
    background-color: var(--danger-color);
}

.verdict-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.verdict-info .sub-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.verdict-info h2 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.25rem;
    letter-spacing: 0.02em;
}

.verdict-icon-container svg {
    width: 48px;
    height: 48px;
}

/* Grid for sub-metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.metric-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

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

.metric-footer {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Confidence circular progress */
.confidence-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.25rem 0;
}

.confidence-gauge {
    position: relative;
    width: 80px;
    height: 80px;
}

.circular-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 3.2;
}

.circle {
    fill: none;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke: var(--accent-blue);
    transition: stroke-dasharray 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Rationale Bubble */
.rationale-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 12px;
}

.rationale-card h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: 0.01em;
}

.rationale-body {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Blockchain Audit Ledger Card */
.ledger-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 1.25rem;
}

.ledger-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ledger-header h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.glow-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-teal);
    box-shadow: 0 0 8px var(--accent-teal);
}

.ledger-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ledger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    padding-bottom: 0.5rem;
}

.ledger-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ledger-item .label {
    color: var(--text-muted);
}

.ledger-item .value {
    color: var(--text-secondary);
    font-weight: 500;
}

.ledger-item .code-val {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.02);
}

.ledger-item .hash-val {
    color: var(--accent-blue);
    font-size: 0.75rem;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-teal) !important;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}
