/* VoIP Web App Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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;
    padding: 20px;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.call-status {
    background: #f8f9fa;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
}

.usage-instructions {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    margin: 0;
}

.usage-instructions h3 {
    text-align: center;
    color: #4f46e5;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.call-types {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.call-type {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid transparent;
}

.call-type.free {
    border-color: #4caf50;
}

.call-type.paid {
    border-color: #ff9800;
}

.call-type h4 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.call-type.free h4 {
    color: #2e7d32;
}

.call-type.paid h4 {
    color: #f57400;
}

.instruction-steps {
    margin: 0;
}

.step {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 0;
}

.step-number {
    background: #4f46e5;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.step-text {
    color: #495057;
    line-height: 1.4;
}

.cost-info {
    text-align: center;
    padding: 12px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    margin-top: 15px;
}

.cost-info p {
    margin: 0;
    color: #2e7d32;
    font-size: 1.1em;
}

/* Enhanced Error Message Styles */
.error-container {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #fd9900;
    margin: 0;
    padding: 0;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-content {
    padding: 20px;
}

.error-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.error-icon {
    font-size: 1.2em;
    margin-right: 8px;
}

.error-header h3 {
    color: #856404;
    font-size: 1.1em;
    margin: 0;
    font-weight: 600;
}

.error-message {
    color: #856404;
    margin-bottom: 15px;
    line-height: 1.4;
}

.error-instructions {
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.error-instructions p {
    color: #856404;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-instructions ul {
    margin: 0;
    padding-left: 20px;
}

.error-instructions li {
    color: #856404;
    margin-bottom: 5px;
    line-height: 1.3;
}

.error-dismiss {
    background: #fd9900;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.error-dismiss:hover {
    background: #e6890a;
}

/* Error variants for different types */
.error-container.error-critical {
    background: #f8d7da;
    border-color: #f5c6cb;
    border-left-color: #dc3545;
}

.error-container.error-critical .error-header h3,
.error-container.error-critical .error-message,
.error-container.error-critical .error-instructions p,
.error-container.error-critical .error-instructions li {
    color: #721c24;
}

.error-container.error-critical .error-dismiss {
    background: #dc3545;
}

.error-container.error-critical .error-dismiss:hover {
    background: #c82333;
}

.video-container {
    position: relative;
    background: #000;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.local-video, .remote-video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
}

.local-video {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 150px;
    height: 100px;
    object-fit: cover;
    border: 2px solid #4f46e5;
    z-index: 10;
}

.remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dialer-container {
    padding: 30px;
}

.phone-number-input {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.phone-number-input input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.2em;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.3s ease;
}

.phone-number-input input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.clear-btn {
    padding: 15px 25px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clear-btn:hover {
    background: #5a6268;
}

.dial-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 300px;
    margin: 0 auto 30px;
}

.dial-btn {
    aspect-ratio: 1;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    font-size: 1.5em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dial-btn span {
    font-size: 0.7em;
    font-weight: 400;
    color: #6c757d;
    margin-top: 2px;
}

.dial-btn:hover {
    background: #e9ecef;
    border-color: #4f46e5;
    transform: scale(1.05);
}

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

.call-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.control-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-call {
    background: #28a745;
    color: white;
}

.audio-call:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

.video-call {
    background: #007bff;
    color: white;
}

.video-call:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-2px);
}

.hangup {
    background: #dc3545;
    color: white;
}

.hangup:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
}

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

.settings-container {
    background: #f8f9fa;
    padding: 25px;
    border-top: 1px solid #e9ecef;
}

.settings-container h3 {
    margin-bottom: 20px;
    color: #495057;
}

.sip-config {
    background: rgba(255, 243, 205, 0.5);
    border-radius: 12px;
    padding: 20px;
    margin-top: 25px;
    border: 1px solid #ffd54f;
}

.sip-config h4 {
    color: #f57400;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.sip-notice {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

.sip-providers {
    font-size: 0.85em;
    color: #666;
    margin-top: 15px;
    line-height: 1.4;
}

.sip-providers a {
    color: #4f46e5;
    text-decoration: none;
}

.sip-providers a:hover {
    text-decoration: underline;
}

.esim-config {
    background: rgba(227, 242, 253, 0.5);
    border-radius: 12px;
    padding: 20px;
    margin-top: 25px;
    border: 1px solid #90caf9;
}

.esim-config h4 {
    color: #1976d2;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.esim-notice {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

.esim-providers {
    font-size: 0.85em;
    color: #666;
    margin-top: 15px;
    line-height: 1.4;
}

.esim-providers a {
    color: #4f46e5;
    text-decoration: none;
}

.esim-providers a:hover {
    text-decoration: underline;
}

.call-type.esim {
    border-color: #2196f3;
}

.call-type.esim h4 {
    color: #1976d2;
}

.setting-item input[type="text"],
.setting-item input[type="password"],
.setting-item input[type="tel"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9em;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.setting-item label {
    min-width: 100px;
    font-weight: 600;
    color: #495057;
}

.setting-item select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
}

.test-btn {
    padding: 8px 16px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.test-btn:hover {
    background: #138496;
}

.connection-info {
    background: #e9ecef;
    padding: 20px 25px;
    border-top: 1px solid #dee2e6;
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.label {
    font-weight: 600;
    color: #495057;
}

.status {
    color: #dc3545;
}

.peer-id {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .app-container {
        border-radius: 15px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .dialer-container {
        padding: 20px;
    }
    
    .call-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .control-btn {
        width: 100%;
        justify-content: center;
    }
    
    .local-video {
        width: 120px;
        height: 80px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .setting-item select {
        width: 100%;
    }
    
    .call-types {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .call-type {
        padding: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .app-container {
        background: rgba(33, 37, 41, 0.95);
        color: #f8f9fa;
    }
    
    .call-status {
        background: #343a40;
        color: #f8f9fa;
        border-bottom-color: #495057;
    }
    
    .settings-container {
        background: #343a40;
        border-top-color: #495057;
    }
    
    .connection-info {
        background: #495057;
        border-top-color: #6c757d;
    }
}
