/* Review Letters Page Styles */

/* Map legacy variables to theme variables */
:root {
    --Maktoub-Dark: var(--bg-primary);
    --Maktoub-Darker: var(--bg-secondary);
    --white: var(--text-primary);
    --Maktoub-Light: var(--text-secondary);
    --Maktoub-Main: var(--color-primary);
    --border-color: var(--border-primary);
    --hover-bg: var(--bg-hover);
}

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

body {
    font-family: 'Janna LT', -apple-system, Roboto, Helvetica, sans-serif;
    background: var(--bg-primary);
    color: var(--white);
    min-height: 100vh;
    direction: rtl;
}

.review-letters-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px 64px;
}

/* Page Title */
.page-title {
    color: var(--white);
    font-size: 48px;
    font-weight: 700;
    line-height: 60px;
    text-align: right;
    margin-bottom: 40px;
}

/* Filters and Actions - Single Horizontal Row */
.filters-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.filter-left {
    display: flex;
    gap: 20px;
    align-items: center;
}

.filter-right {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-left: auto;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 14px;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--Maktoub-Light);
    border-radius: 6px;
    color: var(--Maktoub-Light);
    font-family: 'Janna LT', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn:hover {
    background: rgba(160, 236, 220, 0.1);
}

.export-btn:focus {
    outline: none;
    border-color: var(--Maktoub-Main);
    box-shadow: 0 0 0 2px rgba(30, 168, 150, 0.2);
}

.export-btn svg {
    width: 16px;
    height: 16px;
}

.filter-dropdown {
    position: relative;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 14px;
    justify-content: center;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--Maktoub-Light);
    font-family: 'Janna LT', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
}

.dropdown-btn:hover {
    background: rgba(160, 236, 220, 0.05);
}

.dropdown-btn:focus {
    outline: none;
    border-color: var(--Maktoub-Main);
    box-shadow: 0 0 0 2px rgba(30, 168, 150, 0.2);
}

.dropdown-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.filter-dropdown.active .dropdown-btn svg {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.filter-dropdown.active .dropdown-menu {
    max-height: 400px;
    opacity: 1;
    overflow-y: auto;
}

.dropdown-menu-item {
    display: flex;
    padding: 8px 16px;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    align-self: stretch;
    color: var(--white);
    font-family: 'Janna LT', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(160, 236, 220, 0.1);
}

.dropdown-menu-item:last-child {
    border-bottom: none;
}

.dropdown-menu-item:hover {
    background: rgba(160, 236, 220, 0.1);
}

.dropdown-menu-item.active {
    background: rgba(30, 168, 150, 0.2);
    color: var(--white);
}

.dropdown-menu-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    padding: 12px 14px;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    align-self: stretch;
    background: var(--Maktoub-teal-950);
    border: 1px solid var(--Maktoub-teal-800);
    border-radius: 6px;
    min-width: 300px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus-within {
    border-color: var(--Maktoub-Main);
    box-shadow: 0 0 0 2px rgba(30, 168, 150, 0.2);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--white);
    font-family: 'Janna LT', sans-serif;
    font-size: 14px;
}

.search-box input::placeholder {
    color: var(--Maktoub-Light);
    opacity: 0.6;
}

.search-box svg {
    width: 20px;
    height: 20px;
    color: var(--Maktoub-Light);
}

/* Table Container */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.letters-table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.letters-table th {
    padding: 18px 16px;
    text-align: right;
    color: var(--Maktoub-Light);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-transform: none;
}

.letters-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.letters-table tbody tr:hover {
    background: rgba(30, 168, 150, 0.08);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.letters-table tbody tr:last-child {
    border-bottom: none;
}

.letters-table td {
    padding: 20px 16px;
    color: var(--Maktoub-Light);
    font-size: 14px;
    vertical-align: middle;
}

/* Status Badges */
.status-badge {
    display: flex;
    padding: 2px 10px;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    font-family: "Janna LT";
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    white-space: nowrap;
}

/* Dark mode colors (default) */
.status-badge.ready {
    background: rgba(34, 197, 94, 0.2);
    color: #4ADE80;
}

.status-badge.pending {
    background: rgba(234, 179, 8, 0.2);
    color: #FDE047;
}

.status-badge.approved {
    background: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.2);
    color: #F87171;
}

.status-badge.improvements {
    background: rgba(239, 68, 68, 0.2);
    color: #F87171;
}

/* Light mode colors */
[data-theme="light"] .status-badge.ready {
    background: #E2F5EC;
    color: #008B53;
}

[data-theme="light"] .status-badge.rejected {
    background: #FEEAEA;
    color: #D92D20;
}

[data-theme="light"] .status-badge.improvements {
    background: #FDF2FA;
    color: #C11574;
}

[data-theme="light"] .status-badge.pending {
    background: #FEF7E6;
    color: #B54708;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(160, 236, 220, 0.1);
}

.action-btn:focus {
    outline: none;
    background: rgba(160, 236, 220, 0.15);
    box-shadow: 0 0 0 2px rgba(30, 168, 150, 0.2);
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.action-btn.view svg {
    color: var(--Maktoub-Light);
}

.action-btn.download svg {
    color: #4ADE80;
}

/* Review Button - Replaces Delete Button */
.action-btn.review svg {
    color: var(--Maktoub-Main);
}

.action-btn.review:hover {
    background: rgba(30, 168, 150, 0.15);
}

/* Review Button with Text */
.action-btn.review-with-text {
    width: auto;
    padding: 8px 16px;
    gap: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn.review-with-text span {
    font-family: 'Janna LT', sans-serif;
    font-size: 14px;
    color: var(--Maktoub-Main);
    white-space: nowrap;
}

.action-btn.review-with-text:hover span {
    color: var(--Maktoub-Main);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: rtl;
    height: 38px;
    width: 100%;
    margin-bottom: 32px;
}

.pagination-info {
    color: var(--Maktoub-Light);
    font-size: 14px;
    font-weight: 400;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-btn {
    display: flex;
    padding: 9px 16px;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    border: 1px solid var(--Maktoub-teal-800);
    background: var(--Maktoub-teal-950);
    color: var(--Maktoub-Light);
    font-family: 'Janna LT', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.page-btn:hover:not(:disabled) {
    background: rgba(160, 236, 220, 0.1);
    border-color: var(--Maktoub-Main);
}

.page-btn:focus {
    outline: none;
    border-color: var(--Maktoub-Main);
    box-shadow: 0 0 0 2px rgba(30, 168, 150, 0.2);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.items-per-page select {
    padding: 8px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--Maktoub-Light);
    font-family: 'Janna LT', sans-serif;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.items-per-page select:hover {
    border-color: var(--Maktoub-Main);
    background: rgba(30, 168, 150, 0.1);
}

.items-per-page select:focus {
    border-color: var(--Maktoub-Main);
    box-shadow: 0 0 0 2px rgba(30, 168, 150, 0.2);
}

.items-per-page label {
    color: var(--Maktoub-Light);
    font-size: 14px;
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        padding: 24px 32px;
    }

    .page-title {
        font-size: 36px;
    }

    .table-container {
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px 24px;
    }

    .page-title {
        font-size: 28px;
    }

    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-left,
    .filter-right {
        width: 100%;
        flex-direction: column;
        margin-right: 0;
    }

    .search-box {
        min-width: 100%;
    }

    .pagination-container {
        flex-direction: column;
        gap: 16px;
    }
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 24px 0;
}

.footer-container {
    text-align: center;
}

.copyright {
    color: rgba(160, 236, 220, 0.6);
    font-size: 14px;
    font-weight: 400;
}
