/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Naskh Arabic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* المنيو الجانبي */
.sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.active {
    right: 0;
}

.sidebar-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.close-sidebar:hover {
    background: rgba(255,255,255,0.2);
}

.sidebar-content {
    padding: 20px;
}

/* تسجيل الدخول/الخروج */
.user-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 15px;
}

.user-info i {
    font-size: 1.5rem;
    color: #667eea;
}

.user-info span {
    font-weight: 600;
    color: #2d3748;
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-prompt {
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
}

.login-prompt i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
}

.login-prompt p {
    margin-bottom: 15px;
    color: #718096;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
}

.login-btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.logout-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.clear-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.view-all-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

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

/* المحادثات السابقة */
.conversations-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.conversations-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.conversations-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.conversation-item:hover {
    background: #e2e8f0;
    transform: translateX(-3px);
}

.conv-icon {
    font-size: 1.2rem;
    min-width: 30px;
}

.conv-info {
    flex: 1;
}

.conv-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.conv-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conv-meta small {
    color: #718096;
    font-size: 0.8rem;
}

.conv-time {
    font-size: 0.75rem !important;
}

.no-conversations {
    text-align: center;
    padding: 30px 15px;
    color: #718096;
}

.no-conversations i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #cbd5e0;
}

/* الإحصائيات */
.stats-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
}

.stat-item {
    text-align: center;
    padding: 15px 10px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.stat-item i {
    font-size: 1.2rem;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-item span {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 2px;
}

.stat-item small {
    color: #718096;
    font-size: 0.75rem;
}

/* overlay للمنيو */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* زر فتح المنيو */
.menu-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    z-index: 10;
}

.menu-toggle:hover {
    background: white;
    transform: scale(1.1);
}

.menu-toggle i {
    font-size: 1.2rem;
    color: #667eea;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInDown 1s ease-out;
}

.title i {
    margin: 0 15px;
    color: #FFD700;
    animation: pulse 2s infinite;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
    animation: fadeInUp 1s ease-out 0.5s both;
}

/* Setup Panel */
.setup-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    animation: fadeInUp 1s ease-out 0.7s both;
}

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

.model-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 20px;
}

.model-selector {
    flex: 1;
    text-align: center;
}

.model-selector label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.model-selector label i {
    margin-left: 8px;
    color: #667eea;
}

.select-box {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: #2d3748;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-left: 40px;
}

.select-box:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.select-box:hover {
    border-color: #667eea;
    transform: translateY(-1px);
}

.vs-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.vs-text {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    animation: bounce 2s infinite;
}

/* Topic Form */
.topic-form {
    text-align: center;
}

.stop-form {
    text-align: center;
    margin-top: 15px;
}

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

.input-group i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 1.2rem;
}

.topic-input {
    width: 100%;
    padding: 15px 60px 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    font-size: 1.1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.topic-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.topic-input::placeholder {
    color: #a0aec0;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin: 0 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn i {
    font-size: 1rem;
}

.btn-start {
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
}

.btn-start:hover {
    background: linear-gradient(45deg, #38a169, #2f855a);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
}

.btn-stop {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    margin-top: 10px;
}

.btn-stop:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #fd7e14, #e67e22);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

/* Conversation Container */
.conversation-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    animation: fadeInUp 1s ease-out 0.9s both;
}

.conversation-header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    font-weight: 600;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.conversation {
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
}

.conversation::-webkit-scrollbar {
    width: 8px;
}

.conversation::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}

.conversation::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.conversation::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Messages */
.message {
    margin-bottom: 20px;
    animation: slideInRight 0.5s ease-out;
}

.message.model1 {
    margin-left: 20px;
}

.message.model2 {
    margin-right: 20px;
}

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

.speaker {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

.timestamp {
    color: #718096;
    font-size: 0.9rem;
}

.message-content {
    background: white;
    padding: 15px 20px;
    border-radius: 15px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    line-height: 1.6;
}

.message.model1 .message-content {
    border-left-color: #48bb78;
}

.message.model2 .message-content {
    border-left-color: #ed8936;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state i {
    color: #cbd5e0;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.empty-subtitle {
    font-size: 1rem;
    opacity: 0.7;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -5px, 0);
    }
    70% {
        transform: translate3d(0, -3px, 0);
    }
    90% {
        transform: translate3d(0, -1px, 0);
    }
}

/* Section Titles */
.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #667eea;
}

/* Scenario Selection */
.scenario-selection {
    margin-bottom: 30px;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.scenario-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.scenario-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.scenario-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

.scenario-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.scenario-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.scenario-card p {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.4;
}

/* Characters Setup */
.characters-setup {
    margin-bottom: 30px;
}

.character-selection {
    display: flex;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 20px;
}

.character-card {
    flex: 1;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.character-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.role-icon {
    font-size: 1.5rem;
}

.role-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
}

.character-card .input-group {
    margin-bottom: 15px;
    text-align: right;
}

.character-card .input-group label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 1rem;
}

.name-select, .model-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: #2d3748;
    transition: all 0.3s ease;
}

.name-select:focus, .model-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.name-select:hover, .model-select:hover {
    border-color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .scenario-grid {
        grid-template-columns: 1fr;
    }
    
    .character-selection {
        flex-direction: column;
        gap: 15px;
    }
    
    .vs-indicator {
        order: -1;
        margin-bottom: 15px;
    }
    
    .model-selection {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        display: block;
        width: 100%;
        margin: 10px 0;
        text-align: center;
        justify-content: center;
    }
    
    .message.model1,
    .message.model2 {
        margin-left: 0;
        margin-right: 0;
    }
    
    .conversation {
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    .setup-panel {
        padding: 20px;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .topic-input {
        padding: 12px 50px 12px 15px;
    }
    
    .scenario-card {
        padding: 15px;
    }
    
    .character-card {
        padding: 15px;
    }
}

/* صفحة تسجيل الدخول */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    animation: fadeInUp 1s ease-out;
}

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

.login-header i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
}

.login-header p {
    color: #718096;
    font-size: 1rem;
}

.login-form {
    margin-bottom: 30px;
}

.login-form .input-group {
    position: relative;
    margin-bottom: 20px;
}

.login-form .input-group i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 1.1rem;
}

.login-form input {
    width: 100%;
    padding: 15px 50px 15px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover {
    background: linear-gradient(45deg, #38a169, #2f855a);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
}

.login-features {
    margin-bottom: 20px;
}

.login-features h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
}

.login-features ul {
    list-style: none;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #4a5568;
}

.login-features li i {
    color: #48bb78;
    width: 20px;
}

.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #4c51bf;
}

/* صفحة المحادثات السابقة */
.conversations-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.page-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-button {
    background: #667eea;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #4c51bf;
    transform: scale(1.1);
}

.header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.header-text p {
    color: #718096;
    font-size: 1rem;
}

.conversations-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.search-filter-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-options {
    display: flex;
    gap: 15px;
}

.filter-options select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-options select:focus {
    outline: none;
    border-color: #667eea;
}

.conversations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.conversation-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

.conversation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.card-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-bottom: 1px solid #e2e8f0;
}

.scenario-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scenario-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.vs-small {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-stopped {
    background: #f8d7da;
    color: #721c24;
}

.status-active {
    background: #d1ecf1;
    color: #0c5460;
}

.card-content {
    padding: 20px;
}

.conversation-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    line-height: 1.4;
}

.participants {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 10px;
}

.participant {
    text-align: center;
    flex: 1;
}

.participant-name {
    font-weight: 600;
    color: #2d3748;
    display: block;
    margin-bottom: 2px;
}

.participant small {
    color: #718096;
    font-size: 0.8rem;
}

.participants .vs-text {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.8rem;
}

.conversation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #718096;
    font-size: 0.9rem;
}

.meta-item i {
    color: #667eea;
}

.conversation-preview {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    border-right: 3px solid #667eea;
    margin-bottom: 15px;
}

.conversation-preview p {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.card-actions {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
}

.view-btn, .continue-btn {
    flex: 1;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.view-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.continue-btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

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

.no-conversations-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    color: #718096;
}

.no-conversations-state i {
    color: #cbd5e0;
    margin-bottom: 20px;
}

.no-conversations-state h3 {
    color: #2d3748;
    margin-bottom: 10px;
}

.start-first-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.start-first-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    color: #718096;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.no-results i {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 15px;
}

/* صفحة عرض المحادثة */
.conversation-view-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.conversation-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left, .nav-right {
    display: flex;
    gap: 15px;
}

.back-btn, .home-btn, .export-btn, .share-btn {
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.back-btn, .home-btn {
    background: #667eea;
    color: white;
}

.export-btn, .share-btn {
    background: #48bb78;
    color: white;
}

.back-btn:hover, .home-btn:hover, .export-btn:hover, .share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.conversation-info-section {
    padding: 30px 0;
}

.info-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.conversation-header-info {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
}

.conversation-topic {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 30px;
    line-height: 1.3;
}

.participants-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.participant-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 15px;
    min-width: 200px;
}

.participant-avatar {
    font-size: 3rem;
    background: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.participant-details h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.participant-details p {
    color: #667eea;
    font-weight: 500;
    margin-bottom: 5px;
}

.participant-details small {
    color: #718096;
    font-size: 0.9rem;
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-large {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
}

.conversation-metadata {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.conversation-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 30px;
}

.messages-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.message-wrapper {
    margin-bottom: 25px;
}

.message-wrapper.message1 {
    margin-left: 20px;
}

.message-wrapper.message2 {
    margin-right: 20px;
}

.message-bubble {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-right: 4px solid #667eea;
}

.message-wrapper.message1 .message-bubble {
    border-right-color: #48bb78;
}

.message-wrapper.message2 .message-bubble {
    border-right-color: #ed8936;
}

.message-header-view {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.speaker-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

.message-timestamp {
    color: #718096;
    font-size: 0.9rem;
}

.message-content-view {
    line-height: 1.6;
    color: #4a5568;
}

.empty-conversation {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-conversation i {
    color: #cbd5e0;
    margin-bottom: 20px;
}

.bottom-actions {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.scroll-top-btn, .continue-debate-btn {
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.scroll-top-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
}

.continue-debate-btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.scroll-top-btn:hover, .continue-debate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Responsive Updates */
@media (max-width: 768px) {
    .sidebar {
        width: 300px;
        right: -300px;
    }
    
    .menu-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    .participants-info {
        flex-direction: column;
        gap: 20px;
    }
    
    .vs-divider {
        order: -1;
    }
    
    .search-filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-options {
        justify-content: space-between;
    }
    
    .conversations-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-left, .nav-right {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .conversation-topic {
        font-size: 1.8rem;
    }
    
    .message-wrapper.message1,
    .message-wrapper.message2 {
        margin-left: 0;
        margin-right: 0;
    }
}

/* نظام الرسائل التنبيهية المحسن */
#flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    width: 100%;
    max-width: 400px;
    pointer-events: none;
}

.alert {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-left: 5px solid;
    position: relative;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
    transform: translateX(100%);
    animation: slideInFromRight 0.4s ease forwards;
}

.alert span {
    flex: 1;
    margin-right: 10px;
    color: #333;
    font-size: 15px;
    font-weight: 600;
}

/* أنواع الرسائل */
.alert-success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.alert-success::before {
    content: "✅";
    font-size: 20px;
    margin-left: 12px;
}

.alert-error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.alert-error::before {
    content: "❌";
    font-size: 20px;
    margin-left: 12px;
}

.alert-info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
}

.alert-info::before {
    content: "ℹ️";
    font-size: 20px;
    margin-left: 12px;
}

.alert-warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.alert-warning::before {
    content: "⚠️";
    font-size: 20px;
    margin-left: 12px;
}

/* زر الإغلاق */
.alert-close {
    background: rgba(0,0,0,0.1);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.alert-close:hover {
    background: rgba(0,0,0,0.2);
    color: #333;
    transform: rotate(90deg);
}

/* تأثيرات الحركة */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.alert.removing {
    animation: slideOutToRight 0.3s ease forwards;
}

/* شريط التقدم للإزالة التلقائية */
.alert::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0,0,0,0.2);
    border-radius: 0 0 12px 12px;
    animation: progressBar 5s linear forwards;
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* تصميم متجاوب للجوال */
@media (max-width: 768px) {
    #flash-messages {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
    }
    
    .alert {
        font-size: 14px;
        padding: 14px 16px;
        min-height: 50px;
    }
    
    .alert span {
        font-size: 14px;
    }
}

/* تأثيرات إضافية */
.alert:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.alert:hover::after {
    animation-play-state: paused;
}

/* للرسائل الطويلة */
.alert.long-message {
    max-height: 120px;
    overflow-y: auto;
}

.alert.long-message::-webkit-scrollbar {
    width: 4px;
}

.alert.long-message::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
}

.alert.long-message::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 2px;
}

/* نمط خاص للرسائل المهمة */
.alert-important {
    border: 2px solid;
    font-weight: 700;
    animation: pulse 2s infinite;
}

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