/* =====================================================
   Expired Domains Hunter - Styles
   تصميم عربي RTL مع ألوان احترافية
   ===================================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #10b981;
    --accent-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #2563eb;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

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

body {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    direction: rtl;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 260px;
    min-height: 100vh;
}

/* Top Bar */
.topbar {
    background: var(--surface);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}

.topbar-search {
    flex: 1;
    max-width: 500px;
}

.topbar-search input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s;
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.last-update {
    font-size: 13px;
    color: var(--text-light);
}

/* Pages */
.page {
    display: none;
    padding: 28px;
}

.page.active {
    display: block;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border-right: 4px solid var(--primary);
}

.stat-card.accent { border-right-color: var(--accent); }
.stat-card.warning { border-right-color: var(--warning); }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: var(--bg);
}

.data-table th {
    padding: 12px 16px;
    text-align: right;
    font-weight: 600;
    color: var(--text-light);
    font-size: 13px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: var(--primary-light);
}

.data-table .loading,
.data-table .empty {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Domain name style */
.domain-name {
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

.domain-name:hover {
    text-decoration: underline;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-expired { background: var(--danger-light); color: var(--danger); }
.badge-expiring { background: var(--warning-light); color: #92400e; }
.badge-auction { background: #ede9fe; color: #6d28d9; }
.badge-available { background: var(--accent-light); color: #065f46; }

/* Quality Score */
.quality-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.quality-excellent { background: var(--accent); }
.quality-good { background: #22c55e; }
.quality-average { background: var(--warning); }
.quality-below { background: #f97316; }
.quality-poor { background: var(--danger); }

/* Filters */
.filters-card {
    margin-bottom: 24px;
}

.filters-grid {
    padding: 20px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 6px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding-top: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.filters-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.btn-sm:hover { background: var(--border); }

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.btn-icon:hover { background: var(--bg); }

/* Sort Controls */
.sort-controls {
    display: flex;
    gap: 8px;
}

.sort-controls select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: all 0.2s;
}

.pagination button:hover { background: var(--bg); }
.pagination button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px 8px;
    border-radius: 4px;
}
.modal-close:hover { background: var(--bg); }

.modal-body {
    padding: 24px;
}

/* Modal Detail Sections */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.detail-item {
    background: var(--bg);
    padding: 14px;
    border-radius: 8px;
}

.detail-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h4 {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--text);
}

/* Alert form */
.alert-form {
    padding: 0 24px 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .menu-toggle {
        display: block;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .page {
        padding: 16px;
    }
}

/* DR Bar */
.dr-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dr-bar-fill {
    width: 50px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.dr-bar-fill span {
    display: block;
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

/* Wayback link */
.wayback-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
}
.wayback-link:hover { text-decoration: underline; }

/* Action buttons in table */
.action-btns {
    display: flex;
    gap: 4px;
}

/* Ahrefs link */
a.ahrefs-link {
    color: #ff6600;
    text-decoration: none;
    font-weight: 500;
}
a.ahrefs-link:hover { text-decoration: underline; }
