/* Call Center Agent Dashboard Styles */

:root {
    --primary-color: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --secondary-color: #6b7280;
    --dark-bg: #1f2937;
    --light-bg: #f9fafb;
    --border-color: #e5e7eb;
    --text-dark: #111827;
    --text-light: #6b7280;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-box {
    background: white;
    max-width: 450px;
    margin: 80px auto;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

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

.logo i {
    font-size: 64px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.logo h1 {
    font-size: 24px;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

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

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

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

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

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

.btn-info:hover:not(:disabled) {
    background: #0891b2;
}

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

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Dashboard Header */
.dashboard-header {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left i {
    font-size: 28px;
    color: var(--primary-color);
}

.header-left h2 {
    font-size: 22px;
    color: var(--text-dark);
}

.header-center .agent-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.agent-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-dark);
}

.agent-extension {
    font-size: 13px;
    color: var(--text-light);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sip-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fee2e2;
    color: var(--danger-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.sip-status.connected {
    background: #d1fae5;
    color: var(--success-color);
}

.sip-status i {
    font-size: 10px;
}

/* Dashboard Content */
.dashboard-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.panel {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.panel h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 18px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

/* Agent Status Panel */
.status-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.status-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
}

.status-btn i {
    font-size: 32px;
}

.current-status, .status-timer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--light-bg);
    border-radius: 6px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge.logged-out {
    background: #fee2e2;
    color: var(--danger-color);
}

.status-badge.logged-in {
    background: #dbeafe;
    color: var(--primary-color);
}

.status-badge.ready {
    background: #d1fae5;
    color: var(--success-color);
}

.status-badge.not-ready {
    background: #fef3c7;
    color: var(--warning-color);
}

.status-badge.on-call {
    background: #e0e7ff;
    color: #4f46e5;
}

/* Call Control Panel */
.call-info {
    min-height: 120px;
    margin-bottom: 20px;
}

.no-call {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
}

.no-call i {
    font-size: 48px;
    margin-bottom: 10px;
}

.active-call {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

.active-call .caller-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.active-call .caller-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.active-call .caller-details h4 {
    font-size: 18px;
    margin-bottom: 4px;
}

.active-call .caller-details p {
    font-size: 14px;
    opacity: 0.9;
}

.active-call .call-duration {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin-top: 12px;
}

.call-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.call-buttons .btn-lg {
    grid-column: span 2;
}

/* Transfer Panel */
.transfer-panel {
    margin-top: 20px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 8px;
}

.transfer-panel h4 {
    margin-bottom: 12px;
}

.transfer-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

/* Dialpad */
.dial-display {
    margin-bottom: 16px;
}

.dial-display input {
    width: 100%;
    padding: 16px;
    font-size: 20px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    letter-spacing: 2px;
}

.dialpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.dial-btn {
    aspect-ratio: 1;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dial-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.dial-btn span {
    font-size: 10px;
    font-weight: 400;
    margin-top: 2px;
}

.dial-actions {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
}

/* Call History */
.call-history {
    max-height: 300px;
    overflow-y: auto;
}

.no-history {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

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

.call-history-item:hover {
    background: var(--light-bg);
}

.call-history-item .call-type {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.call-type.inbound {
    background: #dbeafe;
    color: var(--primary-color);
}

.call-type.outbound {
    background: #d1fae5;
    color: var(--success-color);
}

.call-history-item .call-details h5 {
    font-size: 14px;
    margin-bottom: 4px;
}

.call-history-item .call-details p {
    font-size: 12px;
    color: var(--text-light);
}

/* Customer Popup Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUp 0.3s;
}

.modal-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 20px;
}

.close-modal {
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 24px;
    max-height: 50vh;
    overflow-y: auto;
}

.customer-info {
    display: grid;
    gap: 16px;
}

.customer-info.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.customer-field {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding: 12px;
    background: var(--light-bg);
    border-radius: 6px;
}

.customer-field label {
    font-weight: 600;
    color: var(--text-dark);
}

.customer-field span {
    color: var(--text-dark);
}

.modal-footer {
    padding: 20px;
    background: var(--light-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.ringing {
    animation: pulse 1s infinite;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-content {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .dashboard-content {
        grid-template-columns: 1fr;
    }
}

