/* ===== 1. Base UI & Screen Container ===== */
:root {
    --brand-primary: #6366f1;
    --brand-secondary: #a855f7;
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

body {
    background: linear-gradient(180deg, #eef2f7, #f8fafc);
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.phone-frame {
    width: 360px;
    height: 740px; 
    max-height: 95vh; 
    background: #1e293b; 
    border-radius: 50px;
    padding: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 38px;
    position: relative;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
}

.softphone-container {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

/* ===== 2. TecFoni Branding & Toast Notifications ===== */
.brand-logo {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

#toast-container {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    z-index: 5000;
    pointer-events: none;
}

.toast {
    background: #1e293b;
    color: white;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    margin-top: 8px;
    animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Force-hide class - Crucial for JS toggling */
.hidden { 
    display: none !important; 
}

/* Specific fix: Ensure Agent Interface and Modals show as flex when hidden is removed */
#agent-interface:not(.hidden),
#logout-modal:not(.hidden),
#call-overlay:not(.hidden) {
    display: flex !important;
}

/* ===== 3. Interface Transitions ===== */
#login-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.3s ease-out;
}

#agent-interface {
    flex-direction: column;
    height: 100%;
    width: 100%;
    animation: fadeIn 0.4s ease-in-out;
}

/* ===== 4. Login Form Styling ===== */
.form-group {
    margin-bottom: 12px;
}

.login-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2px;
}

.login-input {
    width: 100%;
    padding: 8px 0;
    border: none;
    border-bottom: 2px solid #f1f5f9;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-bottom-color: var(--brand-primary);
}

#login-btn-circle {
    width: 100px;
    height: 60px;
    border-radius: 20px; /* Modern Squircle */
    background: var(--brand-gradient);
    color: white;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
    transition: all 0.2s ease;
    margin: 10px auto; 
    flex-shrink: 0;
}

#login-btn-circle:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.45);
}

/* ===== 5. Agent Navigation & Status ===== */
.agent-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.status-pill-container {
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}

#status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #22c55e; /* Default Green */
    transition: background-color 0.3s ease;
}

.agent-options {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 20px;
}

.option-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 11px;
    background: transparent;
    font-weight: 700;
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn.active-option { 
    background: #ffffff; 
    color: var(--brand-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* ===== 6. Dialpad UI ===== */
#dialpad-module {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Specific style for the dialpad placeholder */
#dial-input::placeholder {
    font-size: 18px;
    font-weight: 500;
    color: #cbd5e1; /* Optional: makes the color a bit lighter/softer */
}

/* Ensure the typing color and size stay bold */
#dial-input {
    width: 100%;
    border: none;
    font-size: 32px; /* Typing size remains large */
    font-weight: 800;
    text-align: center;
    background: transparent;
    outline: none;
    color: #1e293b;
    margin-bottom: 15px;
    caret-color: var(--brand-primary);
}

.dialpad-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}

.dial-btn {
    height: 64px;
    background: #f8fafc;
    border: none;
    border-radius: 18px;
    font-size: 22px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
}

.dial-btn:hover { background: #f1f5f9; }
.dial-btn:active { transform: scale(0.95); background: #e2e8f0; }

#call-btn { 
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: #22c55e; 
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 15px rgba(34, 197, 94, 0.3);
    cursor: pointer;
}

/* ===== 7. Overlays & Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

#call-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #ffffff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 40px 25px;
    box-sizing: border-box;
}

.info-row {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 14px;
    margin-bottom: 8px;
    border: 1px solid #f1f5f9;
}

/* ===== 8. Logout Modal Custom Styles ===== */
#cancel-logout {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    font-weight: 700;
}

#confirm-logout {
    background-color: #ef4444 !important; /* Red Box */
    color: #ffffff !important;
    font-weight: 700;
}