/* Modern Call Center Theme */
:root {
    /* Modern Color Palette */
    --primary: #0066ff;
    --primary-hover: #0052cc;
    --success: #00c853;
    --danger: #ff1744;
    --warning: #ffa726;
    
    /* Neutrals */
    --bg-main: #f5f7fa;
    --bg-card: #ffffff;
    --bg-input: #f8f9fa;
    --border: #e1e4e8;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.75rem;
}

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

#userDisplay {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.btn-logout {
    padding: 0.5rem 1.25rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Main Container */
.main-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Panels */
.left-panel,
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.panel-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

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

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-input);
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

/* Test Info */
.test-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: 8px;
    font-size: 0.9rem;
}

.test-info h4 {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.test-info ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.test-info code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--primary);
    border: 1px solid var(--border);
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.status-dot.disconnected {
    background: var(--danger);
    animation: none;
}

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

#statusText {
    font-weight: 600;
    color: var(--text-primary);
}

/* User Info */
.user-info-box {
    display: grid;
    grid-template-columns: 80px 1fr;
    padding: 0.875rem;
    background: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.user-info-box .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.user-info-box .value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Call Info */
.call-info {
    text-align: center;
    padding: 1.25rem;
    background: var(--bg-input);
    border-radius: 8px;
}

.call-status {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.call-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.call-timer {
    font-size: 1rem;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Courier New', monospace;
}

/* Test Extensions */
.test-extensions {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.test-extensions li {
    padding: 0.625rem 0.875rem;
    background: var(--bg-input);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.test-extensions code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    color: var(--primary);
    font-weight: 600;
    border: 1px solid var(--border);
}

/* Dialpad Container */
.dialpad-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.dialpad-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-primary);
}

/* Number Display */
.number-display {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.number-input {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
    font-family: 'Monaco', 'Courier New', monospace;
    transition: all 0.2s;
}

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

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

.btn-clear {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
    font-size: 1.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

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

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

/* Dialpad Grid */
.dialpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}

.dialpad-btn {
    aspect-ratio: 1;
    padding: 1.25rem;
    font-size: 1.75rem;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dialpad-btn span {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-top: 0.25rem;
}

.dialpad-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dialpad-btn:hover:not(:disabled) span {
    color: rgba(255, 255, 255, 0.8);
}

.dialpad-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

/* Call Controls */
.call-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn-call,
.btn-hangup {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
}

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

.btn-call:hover:not(:disabled) {
    background: #00a043;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-hangup {
    background: var(--danger);
    color: white;
}

.btn-hangup:hover {
    background: #e00032;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

/* In-Call Controls */
.in-call-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.control-btn {
    padding: 0.875rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.control-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.control-btn span:first-child {
    font-size: 1.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .left-panel {
        order: 2;
    }
    
    .right-panel {
        order: 1;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .dialpad-container {
        padding: 1.25rem;
    }
    
    .dialpad-btn {
        font-size: 1.5rem;
        padding: 1rem;
    }
}
