* {
    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;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 450px;
}

.phone-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.phone-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

.phone-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e74c3c;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #2ecc71;
}

.status-dot.connecting {
    background: #f39c12;
}

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

.phone-body {
    padding: 25px;
}

.account-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.info-row .label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.info-row .value {
    color: #333;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.call-status {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
    min-height: 80px;
}

#callState {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

#callNumber {
    font-size: 16px;
    color: #667eea;
    margin-bottom: 5px;
}

#callDuration {
    font-size: 14px;
    color: #666;
}

.number-input {
    position: relative;
    margin-bottom: 20px;
}

#phoneNumber {
    width: 100%;
    padding: 15px 45px 15px 15px;
    font-size: 24px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    outline: none;
    text-align: center;
    font-family: 'Courier New', monospace;
    transition: border-color 0.3s;
}

#phoneNumber:focus {
    border-color: #667eea;
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: #f0f0f0;
    color: #333;
}

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

.dial-key {
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    padding: 20px;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 70px;
}

.dial-key:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.dial-key:active {
    transform: scale(0.95);
    background: #667eea;
    color: white;
}

.dial-key .sub {
    font-size: 10px;
    font-weight: 400;
    color: #666;
    margin-top: 2px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-connect {
    background: #667eea;
    color: white;
}

.btn-connect:hover {
    background: #5568d3;
}

.btn-call {
    background: #2ecc71;
    color: white;
}

.btn-call:hover {
    background: #27ae60;
}

.btn-hangup {
    background: #e74c3c;
    color: white;
}

.btn-hangup:hover {
    background: #c0392b;
}

.btn-answer {
    background: #2ecc71;
    color: white;
}

.btn-answer:hover {
    background: #27ae60;
}

.hidden {
    display: none !important;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.audio-controls label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

#volumeSlider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    background: #e1e8ed;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

#volumeSlider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

#volumeValue {
    font-weight: 600;
    color: #667eea;
    min-width: 45px;
    text-align: right;
}

.log-container {
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    overflow: hidden;
}

.log-header {
    background: #f8f9fa;
    padding: 10px 15px;
    font-weight: 600;
    color: #666;
    font-size: 14px;
    border-bottom: 1px solid #e1e8ed;
}

.log-content {
    max-height: 150px;
    overflow-y: auto;
    padding: 10px 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #333;
    background: #ffffff;
}

.log-content::-webkit-scrollbar {
    width: 6px;
}

.log-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.log-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry .timestamp {
    color: #999;
    margin-right: 8px;
}

.log-entry.error {
    color: #e74c3c;
}

.log-entry.success {
    color: #2ecc71;
}

.log-entry.info {
    color: #3498db;
}

@media (max-width: 500px) {
    body {
        padding: 10px;
    }
    
    .phone-body {
        padding: 15px;
    }
    
    .dial-key {
        padding: 15px;
        height: 60px;
        font-size: 20px;
    }
}
