/* Lawyer Platform - CSS */
:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --secondary: #38a169;
    --danger: #e53e3e;
    --warning: #d69e2e;
    --bg: #f7fafc;
    --card-bg: #ffffff;
    --text: #1a202c;
    --text-muted: #718096;
    --border: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.login-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: var(--primary);
    font-size: 28px;
}

.logo p {
    color: var(--text-muted);
    margin-top: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.error-message {
    background: #fed7d7;
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--border);
}

.btn-call {
    background: var(--secondary);
    color: white;
    padding: 8px 16px;
}

.btn-call:hover {
    opacity: 0.9;
}

.btn-call-large {
    background: var(--secondary);
    color: white;
    padding: 16px 32px;
    font-size: 18px;
}

.btn-end-call {
    background: var(--danger);
    color: white;
    padding: 16px 32px;
    font-size: 18px;
}

/* Dashboard */
.dashboard-container {
    min-height: 100vh;
}

.header {
    background: var(--primary);
    color: white;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    opacity: 0.9;
}

.main-content {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-muted);
    margin-top: 8px;
}

/* Section */
.section {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.section-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 20px;
}

.search-input {
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    width: 250px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.customer-table {
    width: 100%;
    border-collapse: collapse;
}

.customer-table th,
.customer-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.customer-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
}

.customer-table tr:hover {
    background: var(--bg);
}

.debt-amount {
    font-weight: 600;
    color: var(--danger);
}

.loading, .error {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

.error {
    color: var(--danger);
}

/* Third Party Contact Column */
.third-party-cell {
    font-size: 13px;
    line-height: 1.4;
}

.third-party-cell strong {
    color: var(--primary);
}

.third-party-cell small {
    color: var(--text-muted);
}

.third-party-phone {
    color: var(--secondary);
    font-size: 12px;
}

/* Call Page */
.call-container {
    min-height: 100vh;
    background: var(--bg);
}

.back-link {
    color: white;
    text-decoration: none;
    opacity: 0.9;
}

.back-link:hover {
    opacity: 1;
}

.call-main {
    padding: 32px;
    max-width: 800px;
    margin: 0 auto;
}

.customer-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.customer-card h2 {
    margin-bottom: 16px;
    color: var(--primary);
}

.customer-details p {
    margin-bottom: 8px;
    color: var(--text-muted);
}

.customer-details strong {
    color: var(--text);
}

.debt-highlight {
    color: var(--danger);
    font-weight: 700;
    font-size: 18px;
}

.call-controls {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    margin-bottom: 24px;
}

.call-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 20px;
    margin-bottom: 24px;
}

.call-status.connected .status-text { color: var(--secondary); }
.call-status.active .status-text { color: var(--secondary); font-weight: 600; }
.call-status.error .status-text { color: var(--danger); }

.status-icon {
    font-size: 32px;
}

.controls-row {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.audio-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    color: var(--secondary);
}

.audio-bars {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 20px;
}

.audio-bars .bar {
    width: 4px;
    background: var(--secondary);
    border-radius: 2px;
    animation: pulse 0.5s ease-in-out infinite alternate;
}

.audio-bars .bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.audio-bars .bar:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.audio-bars .bar:nth-child(3) { height: 12px; animation-delay: 0.2s; }
.audio-bars .bar:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.audio-bars .bar:nth-child(5) { height: 10px; animation-delay: 0.4s; }

@keyframes pulse {
    from { transform: scaleY(0.5); }
    to { transform: scaleY(1); }
}

/* Call Log */
.call-log {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 24px;
}

.call-log h3 {
    margin-bottom: 16px;
}

#logMessages {
    max-height: 300px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 13px;
}

.log-entry {
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 4px;
    background: var(--bg);
}

.log-success { background: #c6f6d5; color: #22543d; }
.log-error { background: #fed7d7; color: #742a2a; }
.log-info { background: var(--bg); }

