/* home-dashboard.css — Post-login dashboard page */

.home-dashboard {
    min-height: 100vh;
    background: var(--bg-page);
    direction: rtl;
}

body[dir="ltr"] .home-dashboard {
    direction: ltr;
}

/* ── Header ── */
.hd-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.hd-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hd-header .logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.hd-header .header-logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.hd-header .header-titles {
    display: flex;
    flex-direction: column;
}

.hd-header .title-ar {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
}

.hd-header .title-en {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.hd-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hd-username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.header-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.header-link:hover {
    color: var(--primary);
}

/* ── Sections ── */
.hd-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.hd-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.hd-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    padding-right: 16px;
}

.hd-section-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    border-radius: 2px;
}

body[dir="ltr"] .hd-section-title {
    padding-right: 0;
    padding-left: 16px;
}

body[dir="ltr"] .hd-section-title::before {
    right: auto;
    left: 0;
}

.hd-view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.hd-view-all:hover {
    opacity: 0.75;
}

/* ── Method Selection ── */
.method-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.method-card {
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 32px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.method-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 107, 60, 0.12);
}

.method-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: block;
}

.method-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.method-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.method-tag {
    display: inline-block;
    margin-top: 12px;
    background: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ── Contract Upload Step ── */
.hd-contract-step {
    max-width: 560px;
    margin: 0 auto;
}

.hd-back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.hd-back-btn:hover {
    color: var(--primary);
}

.hd-upload-card {
    background: var(--white);
    border: 2px dashed var(--border-default);
    border-radius: 12px;
    padding: 40px 32px;
    text-align: center;
}

.hd-upload-card .upload-icon {
    margin-bottom: 16px;
}

.hd-upload-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.hd-upload-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.hd-upload-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hd-upload-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.hd-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: hdSpin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes hdSpin {
    to { transform: rotate(360deg); }
}

.hd-upload-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 16px;
}

/* ── My Cases Section ── */
.hd-cases-section {
    border-top: 1px solid var(--border-light);
}

.hd-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.hd-cases-grid {
    display: grid;
    gap: 16px;
}

.hd-case-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.hd-case-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(0, 107, 60, 0.08);
}

.hd-case-number {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.hd-case-parties {
    flex: 1;
    min-width: 0;
}

.hd-case-plaintiff {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-case-defendant {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-case-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.hd-case-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hd-empty-cases {
    text-align: center;
    padding: 48px 24px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
}

.hd-empty-cases p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .hd-header-inner {
        flex-wrap: wrap;
        gap: 8px;
    }

    .hd-nav {
        gap: 8px;
        flex-wrap: wrap;
    }

    .hd-section {
        padding: 28px 16px;
    }

    .method-selection {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .hd-case-card {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .hd-header .header-titles {
        display: none;
    }

    .hd-header .header-logo-img {
        width: 36px;
        height: 36px;
    }

    .hd-section-title {
        font-size: 1.1rem;
    }
}
