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

:root {
    --primary: #ff4757;
    --primary-dark: #ff3344;
    --secondary: #2ed573;
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --border: #2d3748;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Password Gate */
#password-gate {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.gate-container {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
}

.gate-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.gate-container h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.gate-container p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

#password-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg-dark);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#password-input:focus {
    border-color: var(--primary);
}

#password-submit {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

#password-submit:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.error {
    color: var(--primary);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 1.2rem;
}

#logout-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

#logout-btn:hover {
    background: var(--border);
    color: var(--text);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Preset Section */
#preset-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.preset-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.preset-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 71, 87, 0.2);
}

.preset-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.preset-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

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

/* Call Section */
#call-section {
    max-width: 600px;
    margin: 0 auto;
}

.call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: 15px 15px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
}

.caller-name {
    font-size: 1.2rem;
    font-weight: bold;
    display: block;
}

.call-status {
    color: var(--secondary);
    font-size: 0.9rem;
}

.call-timer {
    font-size: 1.5rem;
    font-weight: bold;
    font-family: monospace;
}

.call-display {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f23 100%);
    padding: 3rem;
    text-align: center;
    border: 1px solid var(--border);
    border-bottom: none;
}

.call-avatar {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

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

.call-wave {
    display: flex;
    justify-content: center;
    gap: 5px;
    height: 30px;
}

.call-wave span {
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
}

.call-wave span:nth-child(2) { animation-delay: 0.1s; }
.call-wave span:nth-child(3) { animation-delay: 0.2s; }
.call-wave span:nth-child(4) { animation-delay: 0.3s; }
.call-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1.5); }
}

.conversation-log {
    background: var(--bg-dark);
    height: 200px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid var(--border);
    border-bottom: none;
}

.log-entry {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
}

.log-entry.ai {
    background: rgba(255, 71, 87, 0.1);
    border-left: 3px solid var(--primary);
}

.log-entry.user {
    background: rgba(46, 213, 115, 0.1);
    border-left: 3px solid var(--secondary);
    text-align: right;
}

.log-speaker {
    font-weight: bold;
    margin-right: 0.5rem;
}

.log-entry.ai .log-speaker { color: var(--primary); }
.log-entry.user .log-speaker { color: var(--secondary); }

.call-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0 0 15px 15px;
    border: 1px solid var(--border);
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--border);
    color: var(--text);
}

.control-btn:hover {
    transform: scale(1.1);
}

.mic-btn {
    width: 80px;
    height: 80px;
    background: var(--secondary);
}

.mic-btn.recording {
    background: var(--primary);
    animation: recording-pulse 1s infinite;
}

@keyframes recording-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
    50% { box-shadow: 0 0 0 15px rgba(255, 71, 87, 0); }
}

.mic-icon {
    font-size: 1.5rem;
}

.mic-text {
    font-size: 0.7rem;
}

.hangup-btn {
    background: var(--primary);
    width: 80px;
    height: 80px;
}

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

.ai-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive */
@media (max-width: 600px) {
    .preset-grid {
        grid-template-columns: 1fr;
    }

    .call-controls {
        flex-wrap: wrap;
    }
}

.debug-log {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #0a0a15;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.7rem;
    color: #666;
    max-height: 60px;
    overflow-y: auto;
    text-align: center;
}
