﻿/* ========================================
   Variables & General Styles
   ======================================== */
:root {
    --primary-color: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #0891b2;
    --sidebar-width: 272px;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --font-body: 'IRANSans', 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --surface: #ffffff;
    --surface-dim: #f8fafc;
    --surface-container: #f1f5f9;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--surface-container);
    overflow-x: hidden;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Auth Pages Styles
   ======================================== */
.auth-page {
    background: linear-gradient(160deg, #4f46e5 0%, #7c3aed 40%, #a855f7 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .auth-page .card {
        border-radius: var(--radius-xl);
        overflow: hidden;
        border: none;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(10px);
    }

.logo-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35), 0 0 0 4px rgba(79, 70, 229, 0.08);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

    .logo-circle:hover {
        transform: scale(1.05) rotate(3deg);
        box-shadow: 0 12px 32px rgba(79, 70, 229, 0.45), 0 0 0 6px rgba(79, 70, 229, 0.1);
    }

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
    outline: none;
}

/* Password Strength Indicator */
.password-strength .progress-bar {
    transition: width var(--transition-normal), background-color var(--transition-normal);
    border-radius: 99px;
}

    .password-strength .progress-bar.bg-danger {
        background: linear-gradient(90deg, #dc2626, #ef4444) !important;
    }

    .password-strength .progress-bar.bg-warning {
        background: linear-gradient(90deg, #d97706, #f59e0b) !important;
    }

    .password-strength .progress-bar.bg-success {
        background: linear-gradient(90deg, #059669, #10b981) !important;
    }

/* ========================================
   Dashboard Layout
   ======================================== */
.dashboard-page {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-normal);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 28px 20px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar-user {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: transform var(--transition-fast);
}

    .user-avatar:hover {
        transform: scale(1.08);
    }

.sidebar-nav {
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
}

    .sidebar-nav .nav-link {
        color: rgba(255, 255, 255, 0.55);
        padding: 12px 22px;
        display: flex;
        align-items: center;
        text-decoration: none;
        transition: all var(--transition-fast);
        border-right: 3px solid transparent;
        margin: 2px 8px 2px 8px;
        border-radius: 10px;
        font-size: 0.9rem;
        font-weight: 450;
        letter-spacing: 0.01em;
        position: relative;
    }

        .sidebar-nav .nav-link:hover {
            background-color: rgba(255, 255, 255, 0.06);
            color: rgba(255, 255, 255, 0.95);
            border-right-color: transparent;
        }

        .sidebar-nav .nav-link.active {
            background: linear-gradient(135deg, rgba(79, 70, 229, 0.15) 0%, rgba(124, 58, 237, 0.1) 100%);
            color: #fff;
            border-right-color: var(--primary-color);
            font-weight: 550;
            box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.15);
        }

        .sidebar-nav .nav-link i {
            width: 24px;
            margin-left: 14px;
            font-size: 1.05rem;
            opacity: 0.8;
            transition: opacity var(--transition-fast);
        }

        .sidebar-nav .nav-link:hover i,
        .sidebar-nav .nav-link.active i {
            opacity: 1;
        }

/* Main Content */
.main-content {
    margin-right: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    background-color: var(--surface-container);
    transition: margin-right var(--transition-normal), width var(--transition-normal);
}

/* Statistics Cards */
.stat-icon {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

    .stat-icon:hover {
        transform: scale(1.08) rotate(-3deg);
    }

/* Cards */
.card {
    border-radius: var(--radius-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border: 1px solid var(--border-color);
    background: var(--surface);
}

    .card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg) !important;
    }

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%) !important;
}

.bg-gradient-success {
    background: linear-gradient(145deg, #059669 0%, #10b981 50%, #34d399 100%) !important;
}

.bg-gradient-danger {
    background: linear-gradient(145deg, #dc2626 0%, #ef4444 50%, #f87171 100%) !important;
}

.bg-gradient-warning {
    background: linear-gradient(145deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%) !important;
}

/* Tables */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

    .table thead th {
        border-bottom: 2px solid var(--border-color);
        font-weight: 600;
        color: var(--text-secondary);
        background-color: var(--surface-dim);
        padding: 14px 16px;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .table tbody tr {
        transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
    }

        .table tbody tr:hover {
            background-color: rgba(79, 70, 229, 0.03);
        }

    .table tbody td {
        padding: 12px 16px;
        vertical-align: middle;
        border-bottom: 1px solid var(--border-color);
    }

/* Badges */
.badge {
    padding: 5px 12px;
    font-weight: 550;
    border-radius: 99px;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

/* Buttons */
.btn {
    border-radius: var(--radius-sm);
    padding: 10px 22px;
    font-weight: 550;
    transition: all var(--transition-fast);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    }

    .btn:active {
        transform: translateY(0);
        box-shadow: var(--shadow-xs);
    }

.btn-circle {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Profile Page */
.user-avatar-large {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 36px rgba(79, 70, 229, 0.3), 0 0 0 6px rgba(79, 70, 229, 0.08);
    transition: transform var(--transition-normal);
}

    .user-avatar-large:hover {
        transform: scale(1.04);
    }

.info-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--surface-container);
    transition: background-color var(--transition-fast);
}

    .info-item:last-child {
        border-bottom: none;
    }

    .info-item:hover {
        background-color: var(--surface-dim);
    }

/* Modals */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 28px;
    background: var(--surface-dim);
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 28px;
    background: var(--surface-dim);
}

/* Loading States */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Alerts */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    box-shadow: var(--shadow-sm);
    font-weight: 450;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
    }
    .ai_chat_row {
    flex:none !important;
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.25);
    }

    .main-content {
        margin-right: 0;
        width: 100%;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 1rem !important;
    }

    .sidebar-nav .nav-link {
        padding: 11px 18px;
        font-size: 0.88rem;
    }

    .table-responsive {
        font-size: 0.83rem;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.88rem;
    }

    .user-avatar-large {
        width: 110px;
        height: 110px;
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn var(--transition-slow) ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight var(--transition-slow) ease;
}

/* ========================================
   Custom Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c1c8d4;
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: content-box;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
        border: 1px solid transparent;
        background-clip: content-box;
    }

/* ========================================
   Utilities
   ======================================== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-sm-hover:hover {
    box-shadow: var(--shadow-sm) !important;
}

.cursor-pointer {
    cursor: pointer;
}

.border-dashed {
    border-style: dashed !important;
}

/* ========================================
   Project Card Styles
   ======================================== */
.project-card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    overflow: hidden;
}

    .project-card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow-lg);
    }

    .project-card .card-header {
        background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
        color: white;
        border-radius: 0;
        padding: 1.1rem 1.2rem;
        border-bottom: none;
        position: relative;
        overflow: hidden;
    }

        .project-card .card-header::after {
            content: '';
            position: absolute;
            top: -30%;
            right: -20%;
            width: 120px;
            height: 120px;
            background: rgba(255, 255, 255, 0.06);
            border-radius: 50%;
            pointer-events: none;
        }

    .project-card .card-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 1.2rem;
    }

    .project-card .project-title {
        font-size: 1.05rem;
        font-weight: 700;
        margin-bottom: 0.4rem;
        color: white;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        letter-spacing: -0.01em;
    }

    .project-card .project-description {
        color: var(--text-secondary);
        font-size: 0.88rem;
        margin-bottom: 1rem;
        flex: 1;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        line-height: 1.6;
    }

    .project-card .project-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .project-card .project-date {
        font-size: 0.82rem;
        color: var(--text-muted);
        font-weight: 450;
    }

    .project-card .project-actions {
        display: flex;
        gap: 0.5rem;
    }

        .project-card .project-actions .btn {
            flex: 1;
            font-size: 0.85rem;
        }

    .project-card .badge {
        font-size: 0.78rem;
        padding: 0.35rem 0.75rem;
    }

/* ========================================
   Project Details Modal Styles
   ======================================== */

/* Custom Tabs */
#projectDetailsTabs .nav-link {
    color: var(--text-muted);
    font-weight: 550;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all var(--transition-fast);
    padding: 12px 18px;
    font-size: 0.9rem;
}

    #projectDetailsTabs .nav-link:hover {
        color: var(--text-secondary);
        border-bottom-color: var(--border-color);
    }

    #projectDetailsTabs .nav-link.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
        background: transparent;
    }

/* Chat Messages (Project Details) */
.chat-message {
  
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    word-wrap: break-word;
}

    .chat-message.user {
        color: white;
        margin-left: auto;
        border-bottom-right-radius: 0.3rem;
    }

    .chat-message.ai {
        background: var(--surface-container);
        color: var(--text-primary);
        margin-right: auto;
        border-bottom-left-radius: 0.3rem;
        border: 1px solid var(--border-color);
    }

    .chat-message .message-time {
        font-size: 0.73rem;
        opacity: 0.65;
        margin-top: 0.3rem;
    }

/* File Tree View */
.file-tree {
    font-family: 'IRANSans', 'Courier New', monospace;
}

    .file-tree ul {
        list-style: none;
        padding-right: 1.5rem;
        margin: 0;
    }

    .file-tree li {
        padding: 0.5rem;
        cursor: pointer;
        transition: background var(--transition-fast);
        border-radius: 6px;
    }

        .file-tree li:hover {
            background: var(--surface-dim);
        }

    .file-tree .folder::before {
        content: '📁 ';
    }

    .file-tree .file::before {
        content: '📄 ';
    }

    .file-tree .expanded::before {
        content: '📂 ';
    }

/* Build Log Terminal Style */
#buildProgressLog,
#buildPublishLog {
    font-family: 'IRANSans', 'Fira Code', 'Monaco', monospace;
    background: #0d1117 !important;
    color: #c9d1d9 !important;
    line-height: 1.7;
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 0.83rem;
}

    #buildProgressLog .success,
    #buildPublishLog .success {
        color: #3fb950;
    }

    #buildProgressLog .error,
    #buildPublishLog .error {
        color: #f85149;
        font-weight: 600;
    }

    #buildProgressLog .warning,
    #buildPublishLog .warning {
        color: #d29922;
    }

/* Card Shadows */
.card.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

/* Input Focus States */
#projectBuilderForm .form-control:focus,
#projectBuilderForm .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

/* Button Animations */
#startProjectBuild,
#buildProjectBtn,
#publishProjectBtn {
    transition: all var(--transition-fast);
}

    #startProjectBuild:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(5, 150, 105, 0.3);
    }

    #buildProjectBtn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(5, 150, 105, 0.3);
    }

    #publishProjectBtn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(217, 119, 6, 0.3);
    }

/* ========================================
   Chat Styles
   ======================================== */

/* Template Cards */
.template-card {
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    background: var(--surface);
}

    .template-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 28px rgba(79, 70, 229, 0.15) !important;
        border-color: var(--primary-color);
    }

    .template-card:active {
        transform: translateY(-2px);
    }

/* Chat Messages */
.chat-message {
    margin-bottom: 1.2rem;
    animation: fadeInUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    display: flex;
    justify-content: flex-end;
}

.chat-message.assistant {
    display: flex;
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    word-wrap: break-word;
    line-height: 1.65;
}

.chat-message.user .chat-bubble {
    background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.25);
}

.chat-message.assistant .chat-bubble {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin: 0 10px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

    .chat-avatar:hover {
        transform: scale(1.1);
    }

.chat-message.user .chat-avatar {
    background: linear-gradient(145deg, #7c3aed, #a855f7);
    color: white;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.3);
}

.chat-message.assistant .chat-avatar {
    background: linear-gradient(145deg, #e0e7ff, #c7d2fe);
    color: var(--primary-color);
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.12);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 0;
    align-items: center;
}

    .typing-indicator span {
        width: 8px;
        height: 8px;
        background: linear-gradient(145deg, #4f46e5, #7c3aed);
        border-radius: 50%;
        animation: typing 1.4s infinite;
    }

        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* File Upload Preview */
#fileUploadPreview {
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface-dim);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    margin-bottom: 10px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#uploadedFileName {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 450;
}

/* Chat Input */
#aiChatInput {
    border: 2px solid var(--border-color);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    border-radius: var(--radius-md);
}

    #aiChatInput:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
    }

/* Preview Frame */
#htmlPreviewFrame {
    transition: opacity var(--transition-normal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

#previewEmptyState {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: var(--surface-dim);
    border-radius: var(--radius-sm);
}

/* Scrollbar Styling for Chat */
#chatMessagesContainer::-webkit-scrollbar,
#chatTemplates::-webkit-scrollbar {
    width: 6px;
}

#chatMessagesContainer::-webkit-scrollbar-track,
#chatTemplates::-webkit-scrollbar-track {
    background: transparent;
}

#chatMessagesContainer::-webkit-scrollbar-thumb,
#chatTemplates::-webkit-scrollbar-thumb {
    background: #c1c8d4;
    border-radius: 99px;
}

    #chatMessagesContainer::-webkit-scrollbar-thumb:hover,
    #chatTemplates::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* Responsive - Chat */
@media (max-width: 991px) {
    #ai-chat .row {
       /* flex-direction: column;*/
    }

    #ai-chat .col-lg-6 {
        min-height: 50vh;
    }
}

/* Chat Messages (alternate styling for detail context) */
.chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 1.2rem;
    animation: messageSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.25);
}

.chat-message.user .chat-avatar {
    background: linear-gradient(145deg, #7c3aed 0%, #a855f7 100%);
}

.chat-bubble {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
}

.chat-message.user .chat-bubble {
    background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.2);
}

.chat-message.assistant .chat-bubble {
    background: var(--surface-dim);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Code Blocks in Messages */
.chat-bubble pre {
    margin: 10px 0;
    max-height: 400px;
    font-size: 0.82rem;
    line-height: 1.6;
    border-radius: var(--radius-sm);
    overflow: auto;
}

.chat-bubble code {
    font-family: 'IRANSans', 'Fira Code', monospace;
    font-size: 0.82rem;
}

/* Template Cards Hover Effect (re-enforced) */
.template-card {
    transition: all var(--transition-normal);
    cursor: pointer;
    border: 2px solid transparent;
}

    .template-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 32px rgba(79, 70, 229, 0.18);
        border-color: var(--primary-color);
    }

    .template-card:active {
        transform: translateY(-2px);
    }

/* Mobile Responsive - Chat */
@media (max-width: 768px) {
    .chat-bubble {
        max-width: 88%;
        font-size: 0.88rem;
        padding: 12px 14px;
    }

    .chat-avatar {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .template-card {
        margin-bottom: 12px;
    }
}

/* Alert Animation */
.alert {
    animation: alertSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateX(80px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ═══════════════════════════════════════════════════════
   📁 File Manager Styles
   ═══════════════════════════════════════════════════════ */

/* Layout اصلی دو-پنلی */
.file-manager-layout {
    display: flex;
    height: 600px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.file-tree-panel {
    width: 350px;
    min-width: 280px;
    max-width: 500px;
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    background: var(--surface-dim);
    direction: rtl;
    resize: horizontal;
}

.file-content-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    direction: ltr;
}

/* ─── Header محتوای فایل ─── */
.file-content-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(180deg, #1e293b, #0f172a);
    color: #e2e8f0;
    font-size: 0.83rem;
    font-family: 'IRANSans', 'Fira Code', 'Courier New', monospace;
    direction: ltr;
    min-height: 44px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

    .file-content-header span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* ─── Body محتوای فایل ─── */
.file-content-body {
    flex: 1;
    overflow: auto;
    background: #0d1117;
    direction: ltr;
}

.file-content-info {
    font-family: 'IRANSans', monospace;
    font-size: 0.73rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 6px 16px;
    color: #8b949e;
}

/* ─── Code Container ─── */
.code-container {
    height: 100%;
    overflow: auto;
}

    .code-container pre {
        margin: 0;
        padding: 20px;
        background: #0d1117;
        color: #c9d1d9;
        font-family: 'IRANSans', 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
        font-size: 0.83rem;
        line-height: 1.7;
        tab-size: 4;
        white-space: pre;
        overflow-x: auto;
        min-height: 100%;
        counter-reset: line;
    }

        .code-container pre code {
            font-family: inherit;
        }

/* شماره خطوط */
.line-numbers code::before {
    counter-reset: line;
}

/* ─── درخت فایل‌ها ─── */
.file-tree {
    padding: 10px 0;
    font-size: 0.84rem;
    user-select: none;
}

.tree-node {
    /* هر نود */
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    cursor: pointer;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
    gap: 7px;
    white-space: nowrap;
    border-radius: 6px;
    margin: 2px 6px;
}

    .tree-item:hover {
        background: rgba(79, 70, 229, 0.06);
    }

.tree-file.active {
    background: rgba(79, 70, 229, 0.1) !important;
    border-right: 3px solid var(--primary-color);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12);
}

/* آیکون‌ها */
.tree-arrow {
    font-size: 0.6rem;
    width: 14px;
    text-align: center;
    transition: transform var(--transition-fast);
    color: var(--text-muted);
}

.tree-icon {
    font-size: 0.88rem;
    width: 18px;
    text-align: center;
}

.folder-icon {
    color: #eab308 !important;
}

.tree-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'IRANSans', 'Tahoma', sans-serif;
    font-size: 0.83rem;
    color: var(--text-primary);
}

.tree-badge {
    background: var(--border-color);
    color: var(--text-muted);
    font-size: 0.68rem;
    padding: 1px 7px;
    border-radius: 99px;
    margin-right: auto;
    font-weight: 550;
}

.tree-size {
    color: var(--text-muted);
    font-size: 0.73rem;
    margin-right: auto;
}

.tree-download-btn {
    opacity: 0;
    transition: opacity var(--transition-fast);
    color: var(--text-muted) !important;
    font-size: 0.73rem;
}

.tree-item:hover .tree-download-btn {
    opacity: 1;
}

.tree-download-btn:hover {
    color: var(--primary-color) !important;
}

/* ─── File Stats ─── */
.file-stats .stat-item {
    font-size: 0.8rem;
}

/* ─── رنگ‌های خاص ─── */
.text-orange {
    color: #ea580c !important;
}

.text-pink {
    color: #db2777 !important;
}

.text-purple {
    color: #7c3aed !important;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .file-manager-layout {
        flex-direction: column;
        height: auto;
    }

    .file-tree-panel {
        width: 100% !important;
        max-width: 100%;
        max-height: 280px;
        border-left: none;
        border-bottom: 2px solid var(--border-color);
    }

    .file-content-panel {
        min-height: 380px;
    }
}

/* ─── Scrollbar سفارشی ─── */
.file-tree-panel::-webkit-scrollbar,
.file-content-body::-webkit-scrollbar {
    width: 5px;
}

.file-tree-panel::-webkit-scrollbar-thumb,
.file-content-body::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 99px;
}

.file-tree-panel::-webkit-scrollbar-track,
.file-content-body::-webkit-scrollbar-track {
    background: transparent;
}

/* ═══ Build/Publish Log Styles ═══ */
#buildPublishLog .success {
    color: #3fb950;
}

#buildPublishLog .error {
    color: #f85149;
    font-weight: 600;
}

#buildPublishLog .warning {
    color: #d29922;
}

#buildPublishLog .info {
    color: #8b949e;
}

#buildPublishLog .highlight {
    color: #58a6ff;
    font-weight: 600;
}

#buildPublishLog .separator {
    color: #30363d;
    display: block;
    border-bottom: 1px solid #21262d;
    margin: 6px 0;
}

/* ═══ IIS Result Card ═══ */
#iisResultCard .result-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--surface-container);
    transition: background-color var(--transition-fast);
}

    #iisResultCard .result-item:last-child {
        border-bottom: none;
    }

    #iisResultCard .result-item:hover {
        background-color: var(--surface-dim);
    }

#iisResultCard .result-label {
    font-weight: 600;
    min-width: 150px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

#iisResultCard .result-value {
    color: var(--text-primary);
    font-weight: 450;
}


/* ===============================
   ✅ Chat Layout Fix (FINAL)
   =============================== */

.chat-column {
    height: 100%;
}

.chat-header {
    flex-shrink: 0;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
}

.chat-input {
    flex-shrink: 0;
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 0.5rem;
}

.chat-file-preview {
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
    background: var(--surface-dim);
}
/* ===== RIGHT PANEL WRAPPER ===== */
.right-panel-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ===== SWITCHER TABS ===== */
.right-panel-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    gap: 8px;
    flex-shrink: 0;
}

.panel-switcher-tabs {
    display: flex;
    gap: 4px;
    background: #e9ecef;
    padding: 3px;
    border-radius: 8px;
}

.panel-tab-btn {
    position: relative;
    display: flex;
    align-items: center;
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

    .panel-tab-btn:hover {
        color: #495057;
        background: rgba(255,255,255,0.6);
    }

    .panel-tab-btn.active {
        background: #fff;
        color: #0d6efd;
        box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    }

/* ===== UPDATE BADGE ===== */
.plan-update-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    font-size: 0;
    margin-right: 4px;
    margin-left: 2px;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.7;
    }
}

.badge-pulse {
    animation: badgePulse 0.6s ease 3;
}

/* ===== PANEL ACTIONS ===== */
.panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

    .panel-actions .btn {
        padding: 4px 10px;
        font-size: 12px;
        border-radius: 6px;
        transition: all 0.2s;
    }

/* ===== RIGHT PANEL BODY ===== */
.right-panel {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

    .right-panel iframe {
        width: 100%;
        height: 100%;
        border: none;
        display: block;
    }

/* ===== EMPTY STATES ===== */
.plan-empty-state,
.preview-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    padding: 40px 20px;
    text-align: center;
}

.plan-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea20, #764ba220);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 26px;
    color: #667eea;
}

.plan-empty-state h6 {
    font-weight: 700;
    color: #343a40;
    margin-bottom: 8px;
    font-size: 15px;
}

.plan-empty-hints {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.hint-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #6c757d;
}

/* ===== PLAN CONTENT (markdown render) ===== */
.plan-content {
    padding: 20px 24px;
    font-size: 14px;
    line-height: 1.8;
    color: #343a40;
    direction: rtl;
}

    .plan-content .plan-h1 {
        font-size: 20px;
        font-weight: 700;
        color: #0d6efd;
        margin: 20px 0 12px;
        padding-bottom: 8px;
        border-bottom: 2px solid #e9ecef;
    }

    .plan-content .plan-h2 {
        font-size: 17px;
        font-weight: 700;
        color: #343a40;
        margin: 18px 0 10px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .plan-content .plan-h2::before {
            content: '';
            display: inline-block;
            width: 4px;
            height: 18px;
            background: #0d6efd;
            border-radius: 2px;
            flex-shrink: 0;
        }

    .plan-content .plan-h3 {
        font-size: 15px;
        font-weight: 600;
        color: #495057;
        margin: 14px 0 8px;
    }

    .plan-content .plan-paragraph {
        margin-bottom: 12px;
        color: #495057;
    }

    .plan-content .plan-list {
        padding-right: 20px;
        padding-left: 0;
        margin-bottom: 12px;
    }

        .plan-content .plan-list li {
            margin-bottom: 6px;
            padding-right: 4px;
            color: #495057;
        }

    .plan-content .plan-inline-code {
        background: #f1f3f5;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        padding: 1px 6px;
        font-family: 'Courier New', monospace;
        font-size: 12px;
        color: #e83e8c;
    }

    .plan-content .plan-quote {
        border-right: 4px solid #0d6efd;
        border-left: none;
        background: #f8f9ff;
        padding: 10px 16px;
        margin: 12px 0;
        border-radius: 0 8px 8px 0;
        color: #6c757d;
        font-style: italic;
    }

    .plan-content .plan-divider {
        border: none;
        border-top: 1px dashed #dee2e6;
        margin: 20px 0;
    }

    .plan-content strong {
        font-weight: 700;
        color: #212529;
    }

/* ===== UPDATED ANIMATION ===== */
@keyframes planUpdated {
    0% {
        background: #e8f4ff;
    }

    100% {
        background: transparent;
    }
}

.plan-content.just-updated {
    animation: planUpdated 1.5s ease forwards;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .panel-actions .btn span {
        display: none;
    }

    .right-panel-switcher {
        flex-wrap: wrap;
        gap: 6px;
    }
}
/* ===== PLAN CONTENT - TABLE FIX ===== */

/* wrapper برای اسکرول افقی جدول */
.plan-content .table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 16px 0;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.plan-content table {
    width: 100%;
    min-width: 400px;
    border-collapse: collapse;
    font-size: 13px;
    direction: rtl;
}

    /* هدر جدول */
    .plan-content table thead tr {
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: #fff;
    }

    .plan-content table thead th {
        padding: 12px 16px;
        font-weight: 600;
        font-size: 13px;
        text-align: right;
        white-space: nowrap;
        border: none;
        letter-spacing: 0.3px;
    }

    /* ردیف‌های بدنه */
    .plan-content table tbody tr {
        border-bottom: 1px solid #f0f0f0;
        transition: background 0.15s ease;
    }

        .plan-content table tbody tr:last-child {
            border-bottom: none;
        }

        .plan-content table tbody tr:hover {
            background: #f8f9ff;
        }

        /* zebra striping */
        .plan-content table tbody tr:nth-child(even) {
            background: #fafbff;
        }

            .plan-content table tbody tr:nth-child(even):hover {
                background: #f0f2ff;
            }

    .plan-content table td {
        padding: 10px 16px;
        vertical-align: middle;
        color: #495057;
        text-align: right;
        border: none;
        line-height: 1.6;
    }

        /* ستون اول - bold */
        .plan-content table td:first-child {
            font-weight: 600;
            color: #343a40;
        }

    /* footer جدول */
    .plan-content table tfoot tr {
        background: #f8f9fa;
        font-weight: 600;
        border-top: 2px solid #dee2e6;
    }

    .plan-content table tfoot td {
        color: #343a40;
    }
/* ===== CODE BLOCKS در طرح پروژه ===== */
.plan-code-block {
    margin: 14px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e1e4e8;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.plan-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: #24292e;
}

.plan-code-lang {
    font-size: 11px;
    color: #8b949e;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-code-copy {
    background: transparent;
    border: 1px solid #444;
    border-radius: 5px;
    color: #8b949e;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

    .plan-code-copy:hover,
    .plan-code-copy.copied {
        border-color: #58a6ff;
        color: #58a6ff;
    }

.plan-code-pre {
    margin: 0;
    padding: 16px;
    background: #1e1e1e;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.7;
}

    .plan-code-pre code {
        color: #d4d4d4;
        font-family: 'Courier New', Consolas, monospace;
    }

/* ===== SPACER ===== */
.plan-spacer {
    height: 6px;
}

/* ===== PLAN CONTENT عمومی ===== */
.plan-content {
    padding: 20px 24px;
    font-size: 14px;
    line-height: 1.8;
    color: #343a40;
    direction: rtl;
    /* مهم: اسکرول را به .right-panel بسپار */
    min-height: min-content;
}

    .plan-content .plan-h1 {
        font-size: 19px;
        font-weight: 700;
        color: #0d6efd;
        margin: 20px 0 10px;
        padding-bottom: 8px;
        border-bottom: 2px solid #e9ecef;
    }

    .plan-content .plan-h2 {
        font-size: 16px;
        font-weight: 700;
        color: #343a40;
        margin: 18px 0 8px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .plan-content .plan-h2::before {
            content: '';
            display: inline-block;
            width: 4px;
            height: 18px;
            background: linear-gradient(180deg, #667eea, #764ba2);
            border-radius: 2px;
            flex-shrink: 0;
        }

    .plan-content .plan-h3 {
        font-size: 14.5px;
        font-weight: 600;
        color: #495057;
        margin: 14px 0 6px;
    }

    .plan-content .plan-paragraph {
        margin-bottom: 8px;
        color: #495057;
    }

    .plan-content .plan-list {
        padding-right: 22px;
        padding-left: 0;
        margin: 6px 0 12px;
    }

        .plan-content .plan-list li {
            margin-bottom: 5px;
            padding-right: 4px;
            color: #495057;
            line-height: 1.7;
        }

    .plan-content .plan-inline-code {
        background: #f1f3f5;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        padding: 1px 6px;
        font-family: 'Courier New', monospace;
        font-size: 12px;
        color: #e83e8c;
        white-space: nowrap;
    }

    .plan-content .plan-quote {
        border-right: 4px solid #667eea;
        border-left: none;
        background: #f8f9ff;
        padding: 10px 16px 10px 10px;
        margin: 12px 0;
        border-radius: 0 8px 8px 0;
        color: #6c757d;
        font-style: italic;
    }

    .plan-content .plan-divider {
        border: none;
        border-top: 1px dashed #dee2e6;
        margin: 20px 0;
    }
/* ===================== Markdown Renderer CSS ===================== */

/* Headings */
.md-h1 {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 1.2rem 0 .6rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: .3rem;
    color: #1e293b;
}

.md-h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 1rem 0 .5rem;
    color: #334155;
}

.md-h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: .9rem 0 .4rem;
    color: #475569;
}

.md-h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: .8rem 0 .4rem;
    color: #64748b;
}

.md-h5, .md-h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    margin: .7rem 0 .3rem;
}

/* Paragraph */
.md-p {
    line-height: 1.85;
    margin: .5rem 0;
    color: #334155;
}
.user .chat-bubble .md-p {
    color: #ffffff !important;
}
.user .chat-bubble .mt-2 {
    color: #000000ed !important;
}
.md-line {
    display: inline;
}

/* Inline code */
.md-inline-code {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: 'Fira Code', monospace;
    font-size: .88em;
    color: #e53e3e;
}

/* Link */
.md-link {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px dashed #667eea;
}

    .md-link:hover {
        color: #4c51bf;
        border-bottom-style: solid;
    }

/* Image */
.md-img {
    max-width: 100%;
    border-radius: 8px;
    margin: .5rem 0;
}

/* Lists */
.md-list {
    padding-right: 1.5rem;
    margin: .5rem 0;
}

    .md-list li {
        line-height: 1.8;
        color: #334155;
        margin-bottom: .2rem;
    }

/* Blockquote */
.md-blockquote {
    border-right: 4px solid #667eea;
    background: #f0f4ff;
    padding: .6rem 1rem;
    margin: .7rem 0;
    border-radius: 0 8px 8px 0;
    color: #4a5568;
    font-style: italic;
}

/* HR */
.md-hr {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 1rem 0;
}

/* Del */
del {
    color: #94a3b8;
    text-decoration: line-through;
}

/* ===================== Code Block ===================== */
.md-code-block {
    background: #0f172a;
    border-radius: 10px;
    margin: 1rem 0;
    overflow: hidden;
    border: 1px solid #1e293b;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

.md-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .4rem .9rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.md-code-lang {
    font-size: .75rem;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.md-code-copy {
    background: transparent;
    border: 1px solid #475569;
    color: #94a3b8;
    font-size: .75rem;
    padding: 3px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all .2s;
}

    .md-code-copy:hover {
        background: #334155;
        color: #e2e8f0;
    }

    .md-code-copy.copied {
        background: #065f46;
        border-color: #059669;
        color: #34d399;
    }

.md-code-pre {
    margin: 0;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: .875rem;
    line-height: 1.7;
    color: #e2e8f0;
    tab-size: 4;
}

/* ===================== Table ===================== */
.md-table-wrapper {
    overflow-x: auto;
    margin: 1rem 0;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

    .md-table thead tr {
        background: linear-gradient(135deg, #667eea, #764ba2);
    }

    .md-table thead th {
        color: #fff;
        font-weight: 600;
        padding: .7rem 1rem;
        text-align: right;
        white-space: nowrap;
    }

    .md-table tbody td {
        padding: .6rem 1rem;
        border-bottom: 1px solid #f1f5f9;
        color: #334155;
    }

    .md-table .md-tr-odd td {
        background: #f8fafc;
    }

    .md-table tbody tr:last-child td {
        border-bottom: none;
    }

    .md-table tbody tr:hover td {
        background: #eff6ff;
        transition: background .15s;
    }
/* ── نقد پروژه ── */
.critique-content {
    border-top: 3px solid rgba(255, 193, 7, 0.4);
}

#showCritiqueBtn.active {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

#showCritiqueBtn.btn-updated {
    animation: critiquePulse 0.6s ease 3;
}

@keyframes critiquePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.5);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(255, 193, 7, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}
#voiceRecordBtn.btn-recording {
    animation: pulse-red 1s infinite;
    border-color: #dc3545;
    color: #dc3545;
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220,53,69,0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(220,53,69,0);
    }
}
.continuation-marker {
    background: linear-gradient(90deg, #e3f2fd, #bbdefb);
    border-right: 4px solid #2196f3;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 6px;
    font-size: 13px;
    color: #1976d2;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.continuation-marker i {
    color: #2196f3;
}
/* اسکلتون لودینگ */
.skeleton-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* محتوای نقد */
.critique-content {
    line-height: 1.8;
    font-size: 14px;
}

    .critique-content h1,
    .critique-content h2,
    .critique-content h3 {
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
        color: #2c3e50;
    }

    .critique-content ul,
    .critique-content ol {
        padding-right: 1.5rem;
        margin-bottom: 1rem;
    }

    .critique-content code {
        background: #f8f9fa;
        padding: 2px 6px;
        border-radius: 3px;
        font-family: 'Courier New', monospace;
    }

    .critique-content pre {
        background: #f8f9fa;
        padding: 1rem;
        border-radius: 6px;
        overflow-x: auto;
    }

/* اسکرول نرم */
.plan-scroll-area {
    scroll-behavior: smooth;
}

/* انیمیشن ظاهر شدن متن */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.critique-content > * {
    animation: fadeIn 0.3s ease-out;
}
