* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --bg-color: #ecf0f1;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 5px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    direction: rtl;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 30px 0;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}

/* Setup Screen */
.setup-card {
    max-width: 700px;
    margin: 0 auto;
}

.setup-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
    font-size: 2rem;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Role Buttons */
.role-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.role-btn {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 25px 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.role-btn:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.role-btn.selected {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.role-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.role-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
    display: block;
}

.role-desc {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-large {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
}

/* Court Layout */
.court-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    align-items: start;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 20px;
}

.case-info {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.case-info h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.scenario-box {
    background: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.session-stats {
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
}

.session-stats h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
}

.stat-item span:last-child {
    font-weight: 700;
    color: var(--secondary-color);
}

/* Court Main */
.court-main {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    min-height: 700px;
}

.court-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.court-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.your-role {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
}

/* Proceedings */
.proceedings {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 10px;
    max-height: 400px;
}

.message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.judge {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border-left: 5px solid #d35400;
}

.message.user {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-right: 5px solid #21618c;
}

.message.opposing {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border-left: 5px solid #922b21;
}

.message-header {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-content {
    line-height: 1.6;
    white-space: pre-wrap;
}

.feedback-box {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    border-right: 3px solid rgba(255, 255, 255, 0.5);
}

/* Action Panel */
.action-panel {
    border-top: 2px solid var(--border-color);
    padding-top: 20px;
}

/* Argument Modes */
.argument-modes {
    margin-bottom: 20px;
}

.mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.mode-tab {
    padding: 10px 20px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-tab:hover {
    background: var(--border-color);
}

.mode-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.mode-content {
    display: none;
    min-height: 200px;
}

.mode-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* Recording Container */
.recording-container {
    text-align: center;
    padding: 30px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
}

.recording-status {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.status-icon {
    font-size: 1.5rem;
}

.recording-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.recording-controls .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 1rem;
}

.btn-icon {
    font-size: 1.2rem;
}

.recording-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.recording-time {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* Upload Container */
.upload-container {
    text-align: center;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    background: var(--bg-color);
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.05);
}

.upload-area.dragover {
    border-color: var(--success-color);
    background: rgba(39, 174, 96, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.upload-formats {
    font-size: 0.9rem;
    color: var(--text-light);
}

.uploaded-file {
    background: white;
    border: 2px solid var(--success-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.file-icon {
    font-size: 1.5rem;
}

.file-name {
    font-weight: 600;
    color: var(--primary-color);
}

.file-size {
    color: var(--text-light);
    font-size: 0.9rem;
}

.file-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Argument Actions */
.argument-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.argument-info {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Audio Player */
.audio-player {
    width: 100%;
    margin: 15px 0;
}

.audio-player audio {
    width: 100%;
    height: 40px;
}

/* Recording Animation */
.recording-status.recording {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .mode-tabs {
        flex-direction: column;
    }
    
    .recording-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .recording-controls .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .argument-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

.action-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: var(--border-color);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.tab-content {
    min-height: 200px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* Judgment Info */
.judgment-info {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.judgment-info p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.warning {
    color: var(--warning-color);
    font-weight: 600;
}

/* Evaluation Screen */
.evaluation-card {
    max-width: 900px;
    margin: 0 auto;
}

.evaluation-card h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 2rem;
}

.evaluation-content {
    background: var(--bg-color);
    padding: 25px;
    border-radius: 10px;
    line-height: 1.8;
    white-space: pre-wrap;
    max-height: 600px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.evaluation-actions {
    text-align: center;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-overlay p {
    color: white;
    font-size: 1.2rem;
    margin-top: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .court-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .role-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .court-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .action-tabs {
        flex-direction: column;
    }
}

