/* Enhanced Dashboard Custom Styles - Mobile & Desktop Optimized */

/* Responsive Dialer Styles */
.dialer-container {
    max-width: clamp(280px, 90vw, 350px);
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 1.5rem);
}

.dial-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(8px, 2.5vw, 15px);
    margin: clamp(15px, 4vw, 25px) 0;
}

.dial-btn {
    aspect-ratio: 1;
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-weight: bold;
    border: 2px solid #007bff;
    background: white;
    color: #007bff;
    border-radius: 50%;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: clamp(50px, 12vw, 70px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    user-select: none;
}

.dial-btn:hover {
    background: #007bff;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.dial-btn:active {
    transform: scale(0.95);
}

.dial-btn small {
    display: block;
    font-size: clamp(0.6rem, 1.8vw, 0.8rem);
    font-weight: normal;
    margin-top: clamp(-3px, -1vw, -5px);
    line-height: 1;
}

.phone-display {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: clamp(1px, 0.5vw, 3px);
    padding: clamp(0.5rem, 2vw, 1rem);
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    min-height: clamp(50px, 12vw, 70px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Call Status Styles */
.call-status-area {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-timer {
    font-size: 2rem;
    font-weight: bold;
    color: #28a745;
    font-family: 'Courier New', monospace;
}

/* Contact Styles */
.contact-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.contact-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #007bff, #0056b3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 15px;
}

/* Channel Status Styles */
.channel-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-up { background: #d4edda; color: #155724; }
.status-ringing { background: #fff3cd; color: #856404; }
.status-down { background: #f8d7da; color: #721c24; }

/* Statistics Cards */
.stat-card {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Tab Styles */
.nav-tabs .nav-link {
    border-radius: 10px 10px 0 0;
    border: none;
    color: #6c757d;
    padding: 15px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
}

.nav-tabs .nav-link:hover:not(.active) {
    background: #f8f9fa;
    color: #007bff;
}

/* SIP Config Styles */
.config-section {
    border-left: 4px solid #007bff;
    padding-left: 20px;
    margin-bottom: 30px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-connected { background: #28a745; }
.status-disconnected { background: #dc3545; }
.status-testing { background: #ffc107; animation: pulse 1s infinite; }

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

/* Connection Status */
.connection-status .badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    padding: 0;
    margin-right: 8px;
}

/* Custom Scrollbar */
.custom-scroll {
    max-height: 400px;
    overflow-y: auto;
}

.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 3px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dial-pad {
        gap: 8px;
    }
    
    .dial-btn {
        font-size: 1rem;
    }
    
    .phone-display {
        font-size: 1.2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .nav-tabs .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* Loading States */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button Enhancements */
.btn-call {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    padding: 12px 25px;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.btn-call:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-hangup {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    padding: 12px 25px;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.btn-hangup:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

/* Toast Customization */
.toast {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Search Input Enhancement */
.search-input {
    border-radius: 25px;
    padding-left: 45px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Form Enhancements */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

/* Card Enhancements */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 12px 12px 0 0 !important;
    padding: clamp(1rem, 3vw, 1.25rem);
}

.card-body {
    padding: clamp(1rem, 3vw, 1.25rem);
}

/* Mobile-specific responsive breakpoints */
@media (max-width: 575.98px) {
    /* Small phones */
    .dial-pad {
        gap: 6px;
        margin: 15px 0;
    }
    
    .dial-btn {
        min-height: 45px;
        font-size: 1rem;
    }
    
    .phone-display {
        font-size: 1.1rem;
        padding: 0.5rem;
        min-height: 45px;
        letter-spacing: 1px;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .table-responsive {
        font-size: 0.75rem;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    /* Large phones / small tablets */
    .dial-btn {
        min-height: 55px;
        font-size: 1.1rem;
    }
    
    .phone-display {
        font-size: 1.3rem;
        min-height: 55px;
    }
    
    .nav-tabs .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    /* Tablets */
    .dial-btn {
        min-height: 60px;
        font-size: 1.2rem;
    }
    
    .phone-display {
        font-size: 1.5rem;
        min-height: 60px;
    }
}

@media (min-width: 992px) {
    /* Desktop and larger */
    .dial-btn {
        min-height: 65px;
        font-size: 1.3rem;
    }
    
    .phone-display {
        font-size: 1.6rem;
        min-height: 65px;
    }
    
    /* Enhanced hover effects for desktop */
    .nav-tabs .nav-link:hover {
        background-color: rgba(0,123,255,0.1);
        border-color: transparent;
        transition: all 0.2s ease;
    }
    
    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .dial-btn:hover {
        transform: none;
        background: white;
        color: #007bff;
    }
    
    .dial-btn:active {
        background: #007bff;
        color: white;
        transform: scale(0.95);
    }
    
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-tabs .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .dial-btn {
        border-width: 1px;
    }
    
    .card {
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    }
}

/* Landscape orientation adjustments */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .dialer-container {
        max-width: 400px;
    }
    
    .dial-pad {
        gap: 8px;
        margin: 10px 0;
    }
    
    .dial-btn {
        min-height: 40px;
        font-size: 1rem;
    }
    
    .phone-display {
        min-height: 40px;
        font-size: 1.2rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .phone-display {
        background: #343a40;
        border-color: #495057;
        color: #fff;
    }
    
    .dial-btn {
        border-color: #6c757d;
        color: #6c757d;
        background: #343a40;
    }
    
    .dial-btn:hover {
        background: #6c757d;
        color: #343a40;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .dial-btn,
    .btn,
    .card {
        transition: none !important;
    }
    
    .dial-btn:hover {
        transform: none !important;
    }
    
    .btn:hover {
        transform: none !important;
    }
}

/* Focus improvements for keyboard navigation */
.dial-btn:focus,
.btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.nav-tabs .nav-link:focus {
    box-shadow: inset 0 -2px 0 #007bff;
}

/* Print styles */
@media print {
    .dial-pad,
    .btn,
    .nav-tabs {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 15px 15px 0 0 !important;
    font-weight: 600;
}
