/* VoiceShield - Real-time Fraud Detection Styles */

* {
    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, #e3f2fd 0%, #e0f7fa 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: #1a1a1a;
    background: linear-gradient(135deg, #004 0%, #0066ff 100%);
    padding: 30px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

.header-logo {
    width: 40px;
    height: 40px;
}

.header-content {
    text-align: left;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
    font-weight: 500;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

.unified-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 800px;
}

@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: 480px 1fr;
    }
    
    .unified-card {
        margin: 0;
    }
}

.control-panel {
    background: white;
    padding: 30px;
    width: 100%;
}

.control-panel h2 {
    margin-bottom: 20px;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 400;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1a1a1a;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #004AF4;
    box-shadow: 0 0 0 3px rgba(0, 74, 244, 0.1);
}

.btn {
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 400;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #004 0%, #0066ff 100%);
    color: white;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0039c7 0%, #0052cc 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 74, 244, 0.3);
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-warning {
    background: #6b7280;
    color: white;
    border: none;
}

.btn-warning:hover:not(:disabled) {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-warning.muted {
    background: #4b5563;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.status-connecting {
    margin: 16px 0;
    background: #fffbeb;
    color: #92400e;
    height: 36px;
    text-align: center;
    align-content: center;
}

.status-connected {
    margin: 16px 0;
    background: #f7fafc;
    color: #4a5568;
    border-radius: 25px;
    padding: 16px;
    text-align: center;
    font-weight: 400;
    font-size: 14px;
}

.status-disconnected {
    margin: 16px 0;
    background: #f7fafc;
    color: #4a5568;
    border-radius: 25px;
    padding: 16px;
    text-align: center;
    font-weight: 400;
    font-size: 14px;
}

.status-waiting {
    margin: 16px 0;
    background: #d1ecf1;
    color: #0c5460;
    height: 36px;
    text-align: center;
    align-content: center;
}

.info-card {
    padding: 16px 0;
    border-radius: 8px;
    margin-top: 16px;
}

.info-card h3 {
    font-size: 16px;
    color: #2d3748;
    margin-bottom: 10px;
    font-weight: 500;
}

.info-card p {
    margin: 5px 0;
    color: #6b7280;
    font-size: 13px;
}

.info-card strong {
    color: #1a1a1a;
    font-weight: 500;
}

.results-panel {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    height: 800px;
    max-height: 800px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.results-panel h2 {
    margin-bottom: 20px;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 500;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transcript-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    animation: slideIn 0.3s ease-out;
}

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

.transcript-item.caller {
    border-left: 3px solid #007ACC;
    border: 1px solid #D0D7DE;
    border-left: 3px solid #007ACC;
}

.transcript-item.callee {
    border-left: 3px solid #00BFA5;
    background: #E8EDF2;
    border: 1px solid #D0D7DE;
    border-left: 3px solid #00BFA5;
}

.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.speaker-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.speaker-badge.caller {
    background: #007ACC;
    color: #FFFFFF;
}

.speaker-badge.callee {
    background: #00BFA5;
    color: #FFFFFF;
}

.transcript-text {
    color: #1a1a1a;
    line-height: 1.6;
    margin: 10px 0;
    font-size: 14px;
}

.scores-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.score-badge {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.score-low {
    border-radius: 12px;
    background: #d1fae5;
    color: #065f46;
}

.score-medium {
    border-radius: 12px;
    background: #fed7aa;
    color: #92400e;
}

.score-high {
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
}

.processing {
    color: #6b7280;
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #9ca3af;
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.summary-panel {
    margin: 16px 0;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.summary-panel h2 {
    margin-bottom: 20px;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 500;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.summary-card {
    background: #f9fafb;
    padding: 18px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.summary-label {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 400;
}

.summary-value {
    color: #004AF4;
    font-size:token 32px;
    font-weight: 500;
}

.volume-meter {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.volume-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    width: 0%;
    transition: width 0.1s ease-out;
    border-radius: 4px;
}

/* Role-based visibility */
.caller-only {
    display: none;
}

.callee-only {
    display: none;
}

body.role-caller .caller-only {
    display: block;
}

body.role-callee .callee-only {
    display: block;
}

body.role-caller .main-grid {
    display: flex;
    justify-content: center;
}

/* Center unified card when no role is selected */
body:not(.role-caller):not(.role-callee) .main-grid {
    display: flex;
    justify-content: center;
}

body:not(.role-caller):not(.role-callee) .unified-card {
    max-width: 480px;
}

body:not(.role-caller):not(.role-callee) .results-panel,
body:not(.role-caller):not(.role-callee) .summary-panel {
    display: none;
}

body.role-caller .results-panel,
body.role-caller .summary-panel {
    display: none;
}

.role-info-box {
    padding: 16px;
    border-radius: 25px;
    margin-top: 16px;
    text-align: center;
    font-weight: 400;
    font-size: 14px;
}

/* Incoming Call Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1B2C3A;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
    color: #dc2626;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.modal-title {
    font-size: 20px;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 500;
}

.modal-subtitle {
    color: #6b7280;
    margin-bottom: 30px;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.modal-buttons .btn {
    min-width: 120px;
    padding: 12px 32px;
    border-radius: 25px;
    font-weight: 400;
    font-size: 14px;
}

.btn-success {
    background: #10b981;
    color: white;
    border: none;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* Custom radio button styling */
input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

input[type="radio"]:hover {
    border-color: #004AF4;
}

input[type="radio"]:checked {
    border-color: #004AF4;
    box-shadow: 0 0 0 4px rgba(0, 74, 244, 0.2);
    border-radius: 50%;
}

input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #004AF4;
}

/* Centralized Alert Modal */
.alert-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1B2C3A;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.alert-modal-content {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    min-width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s;
}

.alert-modal-icon {
    font-size: 3em;
    margin-bottom: 16px;
}

.alert-modal-message {
    font-size: 16px;
    color: #1a1a1a;
    margin-bottom: 25px;
    line-height: 1.5;
    font-weight: 400;
}

.alert-modal-button {
    min-width: 140px;
    padding: 12px 32px;
    border-radius: 25px;
    font-weight: 400;
    font-size: 14px;
    background: #004AF4;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.alert-modal-button:hover {
    background: #0039c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 74, 244, 0.3);
}

/* ========================================
   FRAUD ALERT STYLES
   ======================================== */

/* Fraud Alert Banner */
.fraud-alert-banner {
    display: none;
    background: white;
    color: #C42B1C;
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(196, 43, 28, 0.2);
    animation: alertSlideIn 0.5s ease-out;
    border: 3px solid #C42B1C;
}

.fraud-alert-banner.active {
    display: block;
}

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

.fraud-alert-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fraud-alert-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.fraud-alert-icon {
    display: none;
}

.fraud-alert-text h3 {
    font-size: 1.3em;
    margin-bottom: 5px;
    font-weight: 700;
    color: #C42B1C;
}

.fraud-alert-text p {
    font-size: 0.95em;
    color: #A02318;
}

.fraud-alert-score {
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    text-align: center;
    border: 3px solid #C42B1C;
}

.fraud-alert-score-label {
    font-size: 0.85em;
    color: #C42B1C;
    margin-bottom: 5px;
    font-weight: 600;
}

.fraud-alert-score-value {
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1;
    color: #C42B1C;
}

/* Fraud Alert Modal */
.fraud-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.fraud-modal.active {
    display: flex;
}

.fraud-modal-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: bounceIn 0.6s ease-out;
    border: 4px solid #C42B1C;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.fraud-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #C42B1C;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.fraud-modal-icon::before {
    content: '!';
    font-size: 3em;
    color: white;
    font-weight: 700;
    line-height: 1;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px) rotate(-5deg); }
    75% { transform: translateX(5px) rotate(5deg); }
}

.fraud-modal-title {
    font-size: 2em;
    color: #C42B1C;
    margin-bottom: 15px;
    font-weight: 700;
}

.fraud-modal-message {
    font-size: 1.1em;
    color: #2d3748;
    margin-bottom: 20px;
    line-height: 1.6;
}

.fraud-modal-score {
    background: white;
    color: #C42B1C;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 3px solid #C42B1C;
}

.fraud-modal-score-label {
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 600;
    color: #C42B1C;
}

.fraud-modal-score-value {
    font-size: 3em;
    font-weight: 700;
    color: #C42B1C;
}

.fraud-modal-btn {
    background: linear-gradient(135deg, #004 0%, #0066ff 100%);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.fraud-modal-btn:hover {
    background: linear-gradient(135deg, #0039c7 0%, #0052cc 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 74, 244, 0.4);
}

