/* ============================================================
   ACRA AI Receptionist — Demo Page (Glass-morphism + BG Image)
   ============================================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #e2e8f0;
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: #60a5fa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================
   Demo Page — Background & Overlay
   ============================================================ */

body.demo-page {
    background-image: url(/static/img/hero.jpg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    z-index: 0;
}

/* ============================================================
   Demo Container & Header
   ============================================================ */

.demo-container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 5rem;
}

.demo-header {
    text-align: center;
    padding: 2rem 0 1rem;
}

.logo {
    width: 180px;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.tagline {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 0.75rem;
}

/* ============================================================
   Call Section
   ============================================================ */

.call-section {
    text-align: center;
    margin: 2.5rem 0;
}

.call-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #22c55e;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4), 0 4px 15px rgba(0,0,0,0.3);
}

.call-button:hover {
    transform: scale(1.08);
    box-shadow: 0 0 50px rgba(34, 197, 94, 0.6), 0 6px 20px rgba(0,0,0,0.4);
}

.call-button.active {
    background: #ef4444;
    animation: pulse-red 2s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4), 0 4px 15px rgba(0,0,0,0.3);
}

.call-button.active:hover {
    transform: scale(1.08);
}

.call-button.ringing {
    background: #f59e0b;
    animation: pulse-ring-btn 0.9s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.5), 0 4px 15px rgba(0,0,0,0.3);
}

.phone-icon {
    font-size: 2.2rem;
    display: block;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.call-status {
    color: rgba(255, 255, 255, 0.65);
    margin-top: 1.25rem;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* ============================================================
   Listening Indicator
   ============================================================ */

.listening-indicator {
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.listening-indicator.hidden {
    display: none;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: #60a5fa;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

/* ============================================================
   Panels — Glass Morphism
   ============================================================ */

.panels {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.glass-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
}

.glass-card h2 {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================
   Transcript
   ============================================================ */

.transcript-content {
    max-height: 350px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

.transcript-content::-webkit-scrollbar {
    width: 5px;
}

.transcript-content::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.transcript-entry {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    line-height: 1.5;
}

.transcript-entry:last-child {
    border-bottom: none;
}

.transcript-entry.user {
    color: #93c5fd;
}

.transcript-entry.assistant {
    color: #e2e8f0;
}

.transcript-entry strong {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.2rem;
    opacity: 0.6;
}

/* ============================================================
   Actions
   ============================================================ */

.actions-content {
    max-height: 350px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

.action-card {
    background: rgba(51, 65, 85, 0.6);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.action-card .action-type {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fbbf24;
    margin-bottom: 0.25rem;
}

.action-card .action-detail {
    color: #cbd5e1;
    margin-bottom: 0.2rem;
}

.action-card .action-result {
    color: #4ade80;
    font-size: 0.76rem;
}

/* ============================================================
   Powered-by badge
   ============================================================ */

.powered-by {
    position: fixed;
    bottom: 1rem;
    right: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    z-index: 2;
}

.powered-by a {
    color: rgba(96, 165, 250, 0.6);
    text-decoration: none;
}

.powered-by a:hover {
    color: rgba(96, 165, 250, 0.9);
}

/* ============================================================
   Keyframe Animations
   ============================================================ */

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.4), 0 4px 15px rgba(0,0,0,0.3);
    }
    50% {
        box-shadow: 0 0 55px rgba(239, 68, 68, 0.75), 0 4px 20px rgba(0,0,0,0.4);
    }
}

@keyframes pulse-ring-btn {
    0%, 100% {
        box-shadow: 0 0 25px rgba(245, 158, 11, 0.5), 0 4px 15px rgba(0,0,0,0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 55px rgba(245, 158, 11, 0.8), 0 4px 20px rgba(0,0,0,0.4);
        transform: scale(1.06);
    }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* ============================================================
   Responsive
   ============================================================ */

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

    .call-button {
        width: 100px;
        height: 100px;
    }

    .phone-icon {
        font-size: 1.8rem;
    }

    .logo {
        width: 140px;
    }
}

/* ============================================================
   Login Page
   ============================================================ */

.login-container {
    max-width: 400px;
    margin: 10vh auto 0;
    background-color: #1e293b;
    border-radius: 1rem;
    padding: 2.5rem;
    border: 1px solid #334155;
}

.login-container h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 1.5rem;
    text-align: center;
}

.error-message {
    background-color: #450a0a;
    color: #fca5a5;
    border: 1px solid #7f1d1d;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.back-link {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: #64748b;
}

/* ============================================================
   Admin Pages
   ============================================================ */

.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.admin-nav {
    background-color: #1e293b;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    border: 1px solid #334155;
}

.admin-nav h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f1f5f9;
}

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

.admin-section {
    background-color: #1e293b;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #334155;
    margin-bottom: 1.5rem;
}

.admin-section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #334155;
}

/* Tables */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    background-color: #0f172a;
    color: #94a3b8;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #334155;
}

tbody tr {
    border-bottom: 1px solid #2d3748;
}

tbody tr:hover {
    background-color: #334155;
}

tbody td {
    padding: 0.7rem 0.75rem;
    color: #cbd5e1;
    vertical-align: top;
}

/* Buttons */

.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 0.4rem;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-align: center;
}

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

.btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-danger {
    background-color: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* Forms */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.4rem;
    padding: 0.65rem 0.85rem;
    color: #e2e8f0;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3b82f6;
}

/* Stat Cards */

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.stat-card {
    background-color: #334155;
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid #475569;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #60a5fa;
    display: block;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    display: block;
}

/* ============================================================
   Admin Responsive
   ============================================================ */

@media (max-width: 768px) {
    .admin-nav {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    table {
        font-size: 0.8rem;
    }
}
