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

/* Main Wrapper */
.main-wrapper {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    align-items: flex-start;
}

/* Container */
.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    flex: 1;
    max-width: 500px;
    text-align: center;
}

/* Call History Panel */
.history-panel {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    flex: 1;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.history-panel h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

/* Call List */
.call-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.call-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.call-item:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateX(5px);
}

.call-item.active {
    background: #e7f0ff;
    border-color: #667eea;
}

.call-item-phone {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    font-family: 'Courier New', monospace;
    margin-bottom: 5px;
}

.call-item-date {
    font-size: 13px;
    color: #666;
}

.call-item-badges {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.badge-audio {
    background: #d4edda;
    color: #155724;
}

.badge-transcript {
    background: #d1ecf1;
    color: #0c5460;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Selected Call Details */
.call-details {
    background: #f9f9f9;
    border-left: 3px solid #007bff;
    margin: 6px 0 10px 10px;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.call-details .transcript-preview {
    max-height: 250px;
    overflow-y: auto;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 10px;
}

.call-details h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #d63447;
    transform: scale(1.05);
}

.transcript-preview {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

/* Heading */
h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Phone Input */
.phone-input {
    margin-bottom: 25px;
}

#phone-number {
    width: 100%;
    padding: 15px 20px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

#phone-number:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Button Group */
.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

/* Buttons */
.btn {
    flex: 1;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.btn-call {
    background: linear-gradient(135deg, #00d09c 0%, #00b383 100%);
    color: white;
}

.btn-call:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 208, 156, 0.3);
}

.btn-call:active:not(:disabled) {
    transform: translateY(0);
}

.btn-hangup {
    background: linear-gradient(135deg, #ff4757 0%, #d63447 100%);
    color: white;
}

.btn-hangup:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 71, 87, 0.3);
}

.btn-hangup:active:not(:disabled) {
    transform: translateY(0);
}

/* Status */
.status {
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 16px;
    color: #555;
    border-left: 4px solid #667eea;
    text-align: left;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.status.success {
    background: #d4edda;
    border-left-color: #00d09c;
    color: #155724;
}

.status.error {
    background: #f8d7da;
    border-left-color: #ff4757;
    color: #721c24;
}

.status.calling {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

/* Download Section */
.download-section {
    margin-top: 30px;
    padding: 25px;
    background: #f0f4ff;
    border-radius: 15px;
    border: 2px solid #667eea;
}

.download-section h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 600;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 25px;
    font-size: 16px;
    width: 100%;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

/* Responsive Design */
@media (max-width: 1000px) {
    .main-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .container,
    .history-panel {
        max-width: 600px;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 26px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Loading Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.status.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Scrollbar Styling */
.history-panel::-webkit-scrollbar,
.transcript-preview::-webkit-scrollbar {
    width: 8px;
}

.history-panel::-webkit-scrollbar-track,
.transcript-preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.history-panel::-webkit-scrollbar-thumb,
.transcript-preview::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.history-panel::-webkit-scrollbar-thumb:hover,
.transcript-preview::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Compact Call List Styles */
.compact-call-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 250px;
    overflow-y: auto;
    padding: 2px;
}

.compact-call-item {
    background: #f8f9fa;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.compact-call-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.compact-call-item.selected {
    border-color: #667eea;
    background: #e7f0ff;
}

.compact-call-header {
    /* margin-top: -50px; */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.compact-call-number {
   
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.compact-call-badges {
    display: flex;
    gap: 5px;
}

.mini-badge {
    font-size: 12px;
}

.compact-call-date {
    /* margin-top: -40px;
    margin-bottom: -40px; */
    font-size: 12px;
    color: #666;
}

/* Scrollbar for compact list */
.compact-call-list::-webkit-scrollbar {
    width: 6px;
}

.compact-call-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.compact-call-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.compact-call-list::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Input field (inline rename) */
.rename-input {
    border: 1px solid #d0d7de;
    border-radius: 6px;
    outline: none;
    padding: 5px 8px;
    font-size: 14px;
    background-color: #f9fafb;
    color: #111;
    transition: all 0.2s ease;
    min-width: 120px;
}

.rename-input:focus {
    border-color: #007bff;
    background-color: #fff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.35);
}

/* Rename button */
.rename-btn {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
    font-size: 13px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
}

/* Hover state */
.rename-btn:hover {
    background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
    border-color: #b6b8bb;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Active (click) state */
.rename-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

/* Disabled state */
.rename-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f3f3f3;
    border-color: #ddd;
    box-shadow: none;
}

/* Optional dark mode adaptation */
@media (prefers-color-scheme: dark) {
    .rename-input {
        background-color: #1e1e1e;
        border-color: #444;
        color: #f2f2f2;
    }

    .rename-input:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.4);
    }

    .rename-btn {
        background: linear-gradient(180deg, #2c2c2c 0%, #1e1e1e 100%);
        border-color: #444;
        color: #eee;
    }

    .rename-btn:hover {
        background: linear-gradient(180deg, #333 0%, #2a2a2a 100%);
        border-color: #666;
        color: #fff;
    }
}

.close-btn{
    margin: 10px;
}
