/* ============================================
   Lie Detector Demo - Styling
   ============================================ */

:root {
    /* Color Palette - Teal Button Theme */
    --primary: #0C7779;
    --primary-dark: #095a5c;
    --primary-light: #0e9496;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-dark: #dc2626;

    /* Neutral Colors - Light Gray Background #ACBAC4 */
    --bg-dark: #ACBAC4;
    --bg-card: #30364F;
    --bg-card-hover: #3d4460;
    --text-primary: #ffffff;
    --text-secondary: #E3E3E3;
    --text-muted: #E3E3E3;
    --border-color: #E3E3E3;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0C7779 0%, #0e9496 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-bg: linear-gradient(180deg, #ACBAC4 0%, #9aaab6 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(29, 161, 242, 0.4);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 20px;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.nav-btn {
    padding: 10px 25px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.nav-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: white;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Form Card */
.form-card {
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.form-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Registration Form */
.registration-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.label-icon {
    font-size: 1.1rem;
}

.form-group input,
.form-group textarea {
    padding: 14px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.3);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* User Badge */
.user-badge {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.user-nik {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.btn-large {
    padding: 16px 24px;
    font-size: 1.05rem;
}

.btn-small {
    flex: 0;
    min-width: auto;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 48px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 5px;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Video Section */
.video-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-lg);
}

.video-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
}

/* Source Tabs */
.source-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.tab-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: var(--bg-dark);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
}

/* Video Player */
#videoPlayer {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    background: #000;
    border-radius: var(--radius-md);
}

#videoContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: white;
}

/* Video Selector */
.video-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.video-selector label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.video-selector select {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Video Face Status */
.video-face-status {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}

.face-indicator {
    font-size: 2rem;
}

#faceStatusText {
    font-size: 0.8rem;
    color: #fff;
}

/* Video Analysis Result */
.video-analysis-result {
    text-align: center;
    padding: 15px;
}

.video-analysis-result h5 {
    margin-bottom: 15px;
    color: var(--primary);
}

.result-stats {
    text-align: left;
    background: var(--bg-dark);
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-top: 15px;
}

.result-stats p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.video-transcript {
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.video-analysis-summary {
    padding: 10px;
}

.video-analysis-summary h5 {
    margin-bottom: 10px;
    color: var(--primary);
}

.video-analysis-summary p {
    margin: 5px 0;
    font-size: 0.9rem;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
}

.video-status {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning);
    animation: blink 1s infinite;
}

.status-dot.active {
    background: var(--success);
}

.status-dot.analyzing {
    background: var(--danger);
    animation: blink 0.5s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Stats Section */
.stats-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-lg);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.stat-card.highlight {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.stat-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
}

/* Timer Section */
.timer-section {
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.timer-display {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.timer-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.timer-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--primary-light);
}

.progress-bar {
    height: 8px;
    background: var(--bg-card-hover);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 1s linear;
}

/* Speech to Text Section */
.speech-section {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
}

.speech-section h4 {
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.speech-section .btn {
    width: 100%;
    margin-bottom: 12px;
}

/* Mode Toggle */
.mode-toggle {
    margin-bottom: 15px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 26px;
    background: var(--bg-card);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s;
    border: 2px solid var(--border-color);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-label input:checked+.toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-label input:checked+.toggle-slider::after {
    transform: translateX(24px);
}

.toggle-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Voice Setup */
.voice-setup {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: 15px;
    border: 1px dashed var(--primary);
}

.setup-status {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

.status-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-item.enrolled {
    color: var(--success);
}

.setup-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-setup {
    flex: 1;
    background: linear-gradient(135deg, #e67e22, #d35400);
    border: none;
    color: white;
    font-size: 0.85rem;
    padding: 12px 10px;
}

.btn-setup:hover {
    background: linear-gradient(135deg, #d35400, #c44a00);
}

.btn-setup:disabled {
    background: #444;
    cursor: not-allowed;
}

.btn-setup.recording {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.8rem;
}

.transcript-box {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 15px;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.transcript-box p,
.transcript-box>div {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.transcript-line {
    padding: 8px 10px;
    margin: 4px 0;
    background: rgba(12, 119, 121, 0.1);
    border-left: 3px solid var(--primary);
    border-radius: 0 6px 6px 0;
    animation: fadeInUp 0.3s ease;
}

.transcript-line .timestamp {
    color: var(--primary-light);
    font-weight: 600;
    margin-right: 8px;
    font-family: monospace;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Speech Controls */
.speech-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.speech-controls .btn {
    flex: 1;
}

.btn-speaker {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.btn-speaker:hover {
    background: var(--primary);
}

.btn-speaker.active {
    background: #e67e22;
    border-color: #e67e22;
    color: white;
}

.speaker-indicator {
    text-align: center;
    padding: 8px;
    margin-bottom: 10px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Transcript Entries */
.transcript-entry {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    border-left: 3px solid;
}

.transcript-entry.speaker-penanya {
    background: rgba(230, 126, 34, 0.15);
    border-left-color: #e67e22;
}

.transcript-entry.speaker-peserta {
    background: rgba(12, 119, 121, 0.15);
    border-left-color: var(--primary);
}

.transcript-entry.current {
    opacity: 0.8;
}

.speaker-label {
    font-weight: 600;
    font-size: 0.8rem;
    display: block;
    margin-bottom: 4px;
}

.speaker-penanya .speaker-label {
    color: #e67e22;
}

.speaker-peserta .speaker-label {
    color: var(--primary);
}

.speaker-text {
    display: block;
    color: var(--text-primary);
}

/* AI Summary */
.btn-ai {
    width: 100%;
    margin-top: 10px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    color: white;
    font-weight: 600;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    transform: translateY(-2px);
}

.btn-ai:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.ai-summary-box {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.1));
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.ai-summary-box h5 {
    margin: 0 0 10px 0;
    color: #a78bfa;
    font-size: 1rem;
}

#aiSummaryContent {
    color: #1a1a2e;
    font-size: 0.9rem;
    line-height: 1.6;
}

#aiSummaryContent strong {
    color: #a78bfa;
}

#aiSummaryContent .loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

#aiSummaryContent .error {
    color: #ef4444;
    padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
}

/* Result Section */
.result-section {
    margin-bottom: 40px;
}

.result-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.result-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.indicator-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    animation: pulse 2s infinite;
}

.indicator-circle.honest {
    background: var(--gradient-success);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.4);
}

.indicator-circle.suspicious {
    background: var(--gradient-warning);
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.4);
}

.indicator-circle.lying {
    background: var(--gradient-danger);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
}

.result-label {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Result Meter */
.result-meter {
    margin-bottom: 30px;
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.meter-bar {
    position: relative;
    height: 20px;
    background: linear-gradient(to right,
            var(--success) 0%,
            var(--warning) 50%,
            var(--danger) 100%);
    border-radius: 10px;
}

.meter-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.meter-pointer {
    position: absolute;
    top: -5px;
    left: 0%;
    width: 4px;
    height: 30px;
    background: white;
    border-radius: 2px;
    box-shadow: var(--shadow-md);
    transition: left 1s ease;
}

/* Result Details */
.result-details {
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.result-details h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.result-details ul {
    list-style: none;
}

.result-details li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-details li:last-child {
    border-bottom: none;
}

.result-details .detail-label {
    color: var(--text-secondary);
}

.result-details .detail-value {
    font-weight: 600;
    color: var(--primary-light);
}

.result-details .detail-value.normal {
    color: var(--success);
}

.result-details .detail-value.warning {
    color: var(--warning);
}

.result-details .detail-value.danger {
    color: var(--danger);
}

/* Interpretation Box */
.interpretation-box {
    background: rgba(29, 161, 242, 0.15);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 20px;
    line-height: 1.6;
    color: var(--text-primary);
}

.interpretation-box strong {
    color: var(--primary-light);
}

/* Detail Row */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-style: italic;
}

.result-details li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.result-details li:last-child {
    border-bottom: none;
}

/* Disclaimer */
.result-disclaimer {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 15px;
    font-size: 0.9rem;
    color: var(--warning);
}

/* Instructions Section */
.instructions-section {
    margin-bottom: 40px;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

@media (max-width: 800px) {
    .instructions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.instruction-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.instruction-number {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 auto 15px;
}

.instruction-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.5s ease forwards;
}

/* Loading Animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--primary-light);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

/* History Page */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.history-filters {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.history-item:hover {
    border-color: var(--primary);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.history-item-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.history-item-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.history-item-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.history-item-badge.honest {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.history-item-badge.suspicious {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.history-item-badge.lying {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.history-item-badge.pending {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

.history-item-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.history-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.history-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.history-actions {
    display: flex;
    gap: 10px;
}

.history-actions .btn {
    flex: 0;
    min-width: auto;
}

/* Loading Placeholder */
.loading-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}