.credit-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
}

.credit-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.78rem;
}

.credit-label {
    font-size: 0.72rem;
    color: var(--light-text);
}

.credit-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--success-color);
}

.credit-actions {
    font-size: 0.68rem;
    color: var(--light-text);
}
.credit-banner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(39, 174, 96, 0.25));
    border: 1px solid rgba(39, 174, 96, 0.35);
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.credit-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.credit-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.credit-label {
    font-size: 0.75rem;
    color: var(--light-text);
}

.credit-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--success-color);
}

.credit-actions {
    font-size: 0.7rem;
    color: var(--light-text);
}
.credit-banner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(39, 174, 96, 0.25));
    border: 1px solid rgba(39, 174, 96, 0.35);
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.credit-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.credit-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.credit-label {
    font-size: 0.75rem;
    color: var(--light-text);
}

.credit-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--success-color);
}

.credit-actions {
    font-size: 0.7rem;
    color: var(--light-text);
}
.credit-banner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(39, 174, 96, 0.25));
    border: 1px solid rgba(39, 174, 96, 0.35);
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.credit-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.credit-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.credit-label {
    font-size: 0.75rem;
    color: var(--light-text);
}

.credit-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success-color);
}

.credit-actions {
    font-size: 0.7rem;
    color: var(--light-text);
}
@font-face {
    font-family: 'Yekan';
    src: url('../fonts/Yekan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #f8f9fa;
    --dark-text: #2c3e50;
    --light-text: #7f8c8d;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Yekan', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ddddda 0%, #ebe8e8 100%);
    min-height: 100vh;
    color: var(--dark-text);
    direction: rtl;
}

/* Navbar */
.navbar {
    background: rgb(185, 185, 184);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--dark-text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: var(--light-bg);
    color: var(--secondary-color);
}

.nav-link.logout {
    background: var(--danger-color);
    color: white;
}

.nav-link.logout:hover {
    background: #c0392b;
}

.nav-user {
    color: var(--light-text);
    font-size: 0.9rem;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-size: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--dark-text);
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    background: var(--light-text);
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.error-message {
    background: #fee;
    color: var(--danger-color);
    padding: 1rem;
    border-radius: 8px;
    border-right: 4px solid var(--danger-color);
}

.success-message {
    background: #efe;
    color: var(--success-color);
    padding: 1rem;
    border-radius: 8px;
    border-right: 4px solid var(--success-color);
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    padding-bottom: 150px;
}

.questions-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.question-card {
    background: transparent;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: none;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Question Bar */
.question-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #6e6a6a 0%, #686767 100%);
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    gap: 0.75rem;
}

.question-text {
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    flex: 1;
    margin: 0;
    line-height: 1.6;
}

.question-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-edit {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 5px;
    transition: all 0.3s;
    color: white;
}

.btn-edit:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.btn-delete {
    background: rgba(6, 59, 95, 0.3);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 5px;
    transition: all 0.3s;
    color: white;
}

.btn-delete:hover {
    background: rgba(52, 152, 219, 0.5);
    transform: scale(1.1);
}

/* Answer Bar */
.answer-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.7rem 1rem;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    gap: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.answer-text {
    color: var(--dark-text);
    line-height: 1.8;
    flex: 1;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    word-wrap: break-word;
}

.answer-text p {
    margin-bottom: 0.8rem;
}

.answer-text p:last-child {
    margin-bottom: 0;
}

.answer-text strong {
    color: var(--primary-color);
}

.answer-text em {
    font-style: italic;
}

.answer-text ul,
.answer-text ol {
    margin: 0.5rem 1.2rem 0.5rem 0;
    padding: 0;
}

.answer-text li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.answer-text blockquote {
    margin: 0.8rem 0;
    padding: 0.75rem 1rem;
    border-right: 4px solid var(--secondary-color);
    background: rgba(52, 152, 219, 0.08);
    border-radius: 10px;
    color: var(--dark-text);
    font-style: italic;
}

.answer-text code {
    background: rgba(52, 152, 219, 0.1);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
}

.answer-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: center;
}

.btn-rating {
    background: white;
    border: 2px solid var(--border-color);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.btn-rating:hover {
    border-color: var(--secondary-color);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-rating.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.btn-rating.active:hover {
    background: #2980b9;
}

/* Input Container */
.input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.input-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.input-box {
    display: flex;
    gap: 0.5rem;
    background: var(--light-bg);
    padding: 0.75rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    align-items: center;
}

.input-box:focus-within {
    border-color: var(--secondary-color);
}

.btn-clear-history {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    order: 3; /* Move to left (right side in RTL) */
}

.btn-clear-history:hover {
    background: #0564b1;
    transform: translateY(-2px);
}

.input-box textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-size: 1rem;
    font-family: inherit;
    max-height: 150px;
    outline: none;
    order: 2;
}

.input-box .btn-send {
    order: 1; /* Keep send button on the right (left side in RTL) */
}

.btn-send {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-send:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-send:disabled {
    background: var(--light-text);
    cursor: not-allowed;
    transform: none;
}

/* Log Page */
.log-page {
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.log-header {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.log-header h1 {
    font-size: 1.6rem;
    color: var(--primary-color);
}

.log-header p {
    color: var(--light-text);
    font-size: 0.95rem;
}

.credit-banner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(39, 174, 96, 0.25));
    border: 1px solid rgba(39, 174, 96, 0.35);
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.credit-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.credit-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.78rem;
}

.credit-label {
    font-size: 0.72rem;
    color: var(--light-text);
}

.credit-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--success-color);
}

.credit-actions {
    font-size: 0.68rem;
    color: var(--light-text);
}

.log-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--dark-text);
    font-size: 0.9rem;
}

.log-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e1e4e8;
    background: white;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.log-table thead {
    background: linear-gradient(135deg, #6e6a6a 0%, #686767 100%);
    color: white;
}

.log-table th,
.log-table td {
    padding: 0.85rem 1rem;
    text-align: right;
    border-bottom: 1px solid #eef0f3;
    vertical-align: top;
}

.log-table tbody tr:hover {
    background: rgba(221, 221, 218, 0.35);
}

.log-table th.text-center,
.log-table td.text-center {
    text-align: center;
}

.log-text {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--dark-text);
    white-space: pre-wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.icon-like,
.icon-dislike,
.icon-dash,
.icon-none {
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.icon-like {
    color: #1abc9c;
    background: rgba(26, 188, 156, 0.15);
}

.icon-dislike {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.15);
}

.icon-dash {
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.12);
    font-weight: 600;
}

.icon-none {
    color: var(--light-text);
    background: rgba(127, 140, 141, 0.12);
    font-weight: 600;
}

.log-empty-state {
    text-align: center;
    padding: 4rem 1rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    border: 1px dashed #d1d5db;
    color: var(--light-text);
}

.log-empty-state h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.pagination-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.pagination {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-item {
    border-radius: 8px;
    overflow: hidden;
}

.page-item.disabled .page-link {
    pointer-events: none;
    opacity: 0.5;
}

.page-item.active .page-link {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: var(--dark-text);
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 2.5rem;
}

.page-link:hover {
    background: rgba(52, 152, 219, 0.15);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.pagination .ellipsis {
    padding: 0.5rem 0.75rem;
    color: var(--light-text);
}

/* Upload Page */
.upload-container {
    max-width: 800px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.upload-box {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.upload-title {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 2rem;
}

.upload-description {
    text-align: center;
    color: var(--light-text);
    margin-bottom: 2rem;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--light-bg);
}

.file-label:hover {
    border-color: var(--secondary-color);
    background: #e8f4f8;
}

.file-label-text {
    font-size: 1.1rem;
    color: var(--dark-text);
}

.file-label-icon {
    font-size: 2rem;
}

.file-name {
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 8px;
    color: var(--dark-text);
}

.btn-upload {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* Loading Overlay */
.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: 2000;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px 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);
    }
}

.loading-text {
    color: white;
    margin-top: 1rem;
    font-size: 1.2rem;
}

/* Register Page */
.register-container {
    max-width: 600px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.register-box {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.register-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-size: 2rem;
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .credit-info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .credit-banner {
        gap: 0.75rem;
    }

    .credit-info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-menu {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .input-box {
        flex-wrap: wrap;
    }
    
    .btn-clear-history {
        order: 3;
        flex: 0 0 auto;
    }
    
    .input-box textarea {
        order: 2;
        min-width: 0;
    }
    
    .input-box .btn-send {
        order: 1;
        flex: 0 0 auto;
    }
    
    .question-header {
        flex-direction: column;
    }
    
    .upload-box,
    .register-box {
        padding: 2rem 1.5rem;
    }

    .log-page {
        padding: 1.5rem;
    }

    .log-table {
        min-width: 100%;
    }

    .log-table th,
    .log-table td {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .credit-info {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    .credit-info {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    .main-container {
        padding: 1rem;
        padding-bottom: 180px;
    }
    
    .question-card {
        padding: 1rem;
    }
    
    .input-container {
        padding: 0.75rem;
    }

    .log-page {
        padding: 1rem;
    }

    .log-table-wrapper {
        border-radius: 10px;
    }

    .pagination {
        gap: 0.3rem;
    }

    .page-link {
        padding: 0.45rem 0.75rem;
        min-width: 2.1rem;
    }
}

