/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    min-height: 100vh;
    color: #333;
}

/* Hero Section */
.page-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hero-section {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 60px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 100%;
}

.hero-section h1 {
    font-size: 3rem;
    color: #4a5568;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-section p {
    font-size: 1.2rem;
    color: #718096;
    margin-bottom: 40px;
    line-height: 1.6;
}

.btn-large {
    padding: 18px 36px;
    font-size: 18px;
    font-weight: 600;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-height: 90vh;
    z-index: 1001;
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

/* Modal Animations */
.modal.show .modal-dialog {
    animation: modalSlideIn 0.3s ease-out;
}

.modal.hiding .modal-dialog {
    animation: modalSlideOut 0.3s ease-in;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

/* Header styles */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    color: #4a5568;
    font-size: 2rem;
    font-weight: 600;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.user-info {
    color: #4a5568;
    font-weight: 500;
}

/* Button styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-call {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    font-size: 18px;
}

.btn-call:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.btn-call:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-hangup {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.btn-hangup:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.4);
}

.btn-control {
    background: #4299e1;
    color: white;
}

.btn-control:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

.btn-control.active {
    background: #e53e3e;
}

/* Main app styles */
#mainApp {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.calling-section {
    margin-bottom: 30px;
}

.call_note_section {
    text-align: end;
}

.btn_save_notes {
    display: block;
    margin: 10px 0 10px 130px;
    width: calc(100% - 130px);
    background-color: #0d6efd;
    color: white;
}

.note-input-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.note-input-section label {
    font-weight: 600;
    color: #4a5568;
    min-width: 120px;
    text-align: start;
}

.note-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.phone-input-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.phone-input-section label {
    font-weight: 600;
    color: #4a5568;
    min-width: 120px;
}

.phone-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.call-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}


.btn-cancel {
    background: #dc2626;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.phone-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Call status styles */
.call-status {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.status-text {
    font-size: 18px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 10px;
}

.call-timer {
    font-size: 24px;
    font-weight: 600;
    color: #667eea;
    font-family: 'Courier New', monospace;
}

/* Call controls styles */
.call-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center !important;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.volume-control label {
    font-weight: 500;
    color: #4a5568;
}

.volume-slider {
    width: 100px;
}

/* Device selection styles */
.device-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.device-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.device-group label {
    font-weight: 600;
    color: #4a5568;
}

.device-select {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    width: 100%
}

.device-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Call history styles */
.call-history-section h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.call-history {
    max-height: 200px;
    overflow-y: auto;
}

.call-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f7fafc;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid #667eea;
}

.call-history-item .phone {
    font-weight: 500;
    color: #4a5568;
}

.call-history-item .time {
    font-size: 12px;
    color: #718096;
}

.call-history-item .duration {
    font-size: 12px;
    color: #4299e1;
    font-weight: 500;
}

/* Setup instructions styles */
.setup-instructions {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.setup-instructions h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.setup-instructions ol {
    padding-left: 20px;
}

.setup-instructions li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #4a5568;
}

.setup-instructions ul {
    margin: 10px 0;
    padding-left: 20px;
}

.setup-instructions code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e53e3e;
}

.setup-instructions a {
    color: #667eea;
    text-decoration: none;
}

.setup-instructions a:hover {
    text-decoration: underline;
}

/* Status indicators */
.status-connecting {
    color: #f6ad55 !important;
}

.status-connected {
    color: #48bb78 !important;
}

.status-error {
    color: #f56565 !important;
}

.status-ended {
    color: #718096 !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .hero-section {
        padding: 40px 20px;
        margin: 20px;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .modal-dialog {
        width: 98%;
        margin: 10px;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .container {
        padding: 15px;
    }
    
    .auth-section {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .phone-input-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .phone-input-section label {
        min-width: auto;
    }
    
    .call-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .volume-control {
        margin-left: 0;
        justify-content: center;
    }
    
    .device-selection {
        grid-template-columns: 1fr;
    }
    
    .call-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .btn-large {
        padding: 15px 30px;
        font-size: 16px;
    }
    
    .modal-dialog {
        width: 100%;
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-content {
        border-radius: 0;
        max-height: 100vh;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
