/* ============================================
   Agencies Premium - Government Official / VIP Style
   Nafiz UAE Portal Premium Theme
   ============================================ */

/* CSS Variables */
:root {
    --ga-primary: #143F52;
    --ga-primary-dark: #0d2d3a;
    --ga-primary-light: #1a5570;
    --ga-accent: #2196a9;
    --ga-accent-light: #28b5c9;
    --ga-bg: #f7f9fb;
    --ga-bg-alt: #eef2f5;
    --ga-card: #ffffff;
    --ga-card-hover: #fafcfd;
    --ga-border: rgba(20, 63, 82, 0.12);
    --ga-border-strong: rgba(20, 63, 82, 0.2);
    --ga-text: #143F52;
    --ga-text-muted: #5a7282;
    --ga-text-light: #8a9da8;
    --ga-shadow-sm: 0 2px 8px rgba(20, 63, 82, 0.08);
    --ga-shadow-md: 0 4px 16px rgba(20, 63, 82, 0.1);
    --ga-shadow-lg: 0 8px 32px rgba(20, 63, 82, 0.12);
    --ga-shadow-hover: 0 12px 40px rgba(20, 63, 82, 0.15);
    --ga-radius-sm: 8px;
    --ga-radius-md: 12px;
    --ga-radius-lg: 16px;
    --ga-radius-xl: 20px;
    --ga-glass: rgba(255, 255, 255, 0.85);
    --ga-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --ga-highlight: #fff3cd;
}

/* RTL Support */
[dir="rtl"] .ga-page,
html[lang="ar"] .ga-page {
    direction: rtl;
}

/* Base Page Styles */
.ga-page {
    background: var(--ga-bg);
    min-height: 100vh;
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

/* ============================================
   Premium Breadcrumb
   ============================================ */
.ga-breadcrumb-wrapper {
    background: linear-gradient(135deg, var(--ga-primary) 0%, var(--ga-primary-light) 100%);
    padding: 1.5rem 0;
    margin-bottom: 0;
}

.ga-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ga-breadcrumb-item {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.ga-breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--ga-transition);
}

.ga-breadcrumb-item a:hover,
.ga-breadcrumb-item a:focus {
    color: #ffffff;
    text-decoration: underline;
}

.ga-breadcrumb-item.active {
    color: #ffffff;
    font-weight: 600;
}

.ga-breadcrumb-item + .ga-breadcrumb-item::before {
    content: '/';
    margin: 0 0.5rem;
    color: rgba(255, 255, 255, 0.5);
}

[dir="rtl"] .ga-breadcrumb-item + .ga-breadcrumb-item::before {
    content: '\\';
}

/* ============================================
   Main Content Area
   ============================================ */
.ga-main-content {
    padding: 2rem 0 3rem;
}

/* ============================================
   Premium Sidebar
   ============================================ */
.ga-sidebar-wrapper {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ga-border-strong) transparent;
}

.ga-sidebar-wrapper::-webkit-scrollbar {
    width: 6px;
}

.ga-sidebar-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.ga-sidebar-wrapper::-webkit-scrollbar-thumb {
    background: var(--ga-border-strong);
    border-radius: 3px;
}

.ga-sidebar {
    background: var(--ga-card);
    border-radius: var(--ga-radius-xl);
    box-shadow: var(--ga-shadow-md);
    overflow: hidden;
    border: 1px solid var(--ga-border);
}

.ga-sidebar-header {
    background: linear-gradient(135deg, var(--ga-primary) 0%, var(--ga-primary-light) 100%);
    padding: 1.25rem 1.5rem;
    color: #ffffff;
}

.ga-sidebar-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ga-sidebar-title i,
.ga-sidebar-title svg {
    opacity: 0.9;
}

.ga-sidebar-body {
    padding: 1rem;
}

/* Sidebar Navigation Items */
.ga-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ga-nav-item {
    margin-bottom: 0.5rem;
}

.ga-nav-item:last-child {
    margin-bottom: 0;
}

.ga-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-radius: var(--ga-radius-md);
    background: var(--ga-bg);
    color: var(--ga-text);
    text-decoration: none;
    transition: var(--ga-transition);
    border: 1px solid transparent;
    gap: 0.75rem;
    cursor: pointer;
}

.ga-nav-link:hover,
.ga-nav-link:focus {
    background: var(--ga-bg-alt);
    border-color: var(--ga-border);
    color: var(--ga-primary);
    transform: translateX(4px);
    text-decoration: none;
}

[dir="rtl"] .ga-nav-link:hover,
[dir="rtl"] .ga-nav-link:focus {
    transform: translateX(-4px);
}

.ga-nav-link:focus-visible {
    outline: 2px solid var(--ga-accent);
    outline-offset: 2px;
}

.ga-nav-link.active {
    background: linear-gradient(135deg, var(--ga-primary) 0%, var(--ga-primary-light) 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--ga-shadow-sm);
}

.ga-nav-link.active:hover {
    transform: none;
    background: linear-gradient(135deg, var(--ga-primary-dark) 0%, var(--ga-primary) 100%);
}

.ga-nav-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.ga-nav-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ga-accent);
    flex-shrink: 0;
}

.ga-nav-link.active .ga-nav-icon {
    background: #ffffff;
}

.ga-nav-text {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ga-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 0.5rem;
    border-radius: 12px;
    background: var(--ga-accent);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.ga-nav-link.active .ga-nav-badge {
    background: rgba(255, 255, 255, 0.25);
}

/* Top Services Sidebar Card */
.ga-top-services {
    margin-top: 1.5rem;
}

.ga-top-service-item {
    display: flex;
    align-items: flex-start;
    padding: 0.875rem 1rem;
    border-radius: var(--ga-radius-md);
    background: var(--ga-bg);
    color: var(--ga-text);
    text-decoration: none;
    transition: var(--ga-transition);
    margin-bottom: 0.5rem;
}

.ga-top-service-item:hover {
    background: var(--ga-bg-alt);
    color: var(--ga-accent);
    text-decoration: none;
}

.ga-top-service-item:focus-visible {
    outline: 2px solid var(--ga-accent);
    outline-offset: 2px;
}

/* See More Button */
.ga-see-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--ga-border-strong);
    border-radius: var(--ga-radius-md);
    background: transparent;
    color: var(--ga-accent);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ga-transition);
}

.ga-see-more-btn:hover,
.ga-see-more-btn:focus {
    background: var(--ga-bg);
    border-color: var(--ga-accent);
}

/* ============================================
   Main Results Area
   ============================================ */
.ga-results-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header Section with Search */
.ga-header-section {
    background: var(--ga-card);
    border-radius: var(--ga-radius-xl);
    box-shadow: var(--ga-shadow-md);
    padding: 1.5rem;
    border: 1px solid var(--ga-border);
}

.ga-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ga-group-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ga-group-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ga-primary);
    line-height: 1.3;
}

.ga-services-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--ga-accent) 0%, var(--ga-accent-light) 100%);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
}

.ga-subgroup-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--ga-radius-sm);
    background: var(--ga-bg);
    color: var(--ga-text-muted);
    font-size: 0.9rem;
    border: 1px solid var(--ga-border);
}

.ga-subgroup-name {
    font-weight: 600;
    color: var(--ga-primary);
}

/* Search Container */
.ga-search-container {
    position: relative;
}

.ga-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--ga-bg);
    border: 2px solid var(--ga-border);
    border-radius: var(--ga-radius-lg);
    transition: var(--ga-transition);
    overflow: hidden;
}

.ga-search-wrapper:focus-within {
    border-color: var(--ga-accent);
    box-shadow: 0 0 0 4px rgba(33, 150, 169, 0.1);
}

.ga-search-group-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--ga-primary);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border-radius: var(--ga-radius-sm);
    margin: 0.5rem;
    margin-inline-end: 0;
}

.ga-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    color: var(--ga-text-muted);
}

.ga-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 1rem 0;
    font-size: 1rem;
    color: var(--ga-text);
    outline: none;
    min-width: 0;
}

.ga-search-input::placeholder {
    color: var(--ga-text-light);
}

.ga-search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-inline-end: 0.5rem;
    border: none;
    background: var(--ga-bg-alt);
    color: var(--ga-text-muted);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--ga-transition);
}

.ga-search-clear.visible {
    display: flex;
}

.ga-search-clear:hover {
    background: var(--ga-border-strong);
    color: var(--ga-primary);
}

.ga-search-clear:focus-visible {
    outline: 2px solid var(--ga-accent);
    outline-offset: 2px;
}

.ga-search-loader {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
}

.ga-search-loader.visible {
    display: flex;
}

.ga-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--ga-border);
    border-top-color: var(--ga-accent);
    border-radius: 50%;
    animation: ga-spin 0.8s linear infinite;
}

@keyframes ga-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Results Card Container
   ============================================ */
.ga-results-card {
    background: var(--ga-card);
    border-radius: var(--ga-radius-xl);
    box-shadow: var(--ga-shadow-md);
    border: 1px solid var(--ga-border);
    overflow: hidden;
}

.ga-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--ga-primary) 0%, var(--ga-primary-light) 100%);
    color: #ffffff;
}

.ga-results-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.ga-results-body {
    padding: 1rem;
    min-height: 200px;
}

/* Loader for results */
.ga-results-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 1rem;
}

.ga-loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--ga-border);
    border-top-color: var(--ga-accent);
    border-radius: 50%;
    animation: ga-spin 0.8s linear infinite;
}

.ga-loader-text {
    color: var(--ga-text-muted);
    font-size: 0.95rem;
}

/* Empty State */
.ga-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.ga-empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    color: var(--ga-text-light);
    opacity: 0.5;
}

.ga-empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ga-text);
    margin-bottom: 0.5rem;
}

.ga-empty-text {
    color: var(--ga-text-muted);
    font-size: 0.95rem;
}

/* ============================================
   Service Card - Premium Design
   ============================================ */
.ga-services-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ga-service-card {
    display: block;
    background: var(--ga-bg);
    border: 1px solid var(--ga-border);
    border-radius: var(--ga-radius-lg);
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: var(--ga-transition);
    position: relative;
}

.ga-service-card:hover {
    background: var(--ga-card-hover);
    border-color: var(--ga-accent);
    box-shadow: var(--ga-shadow-hover);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.ga-service-card:focus-visible {
    outline: 2px solid var(--ga-accent);
    outline-offset: 2px;
}

.ga-service-card:active {
    transform: translateY(0);
}

.ga-service-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ga-service-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ga-accent) 0%, var(--ga-accent-light) 100%);
    flex-shrink: 0;
    margin-top: 0.4rem;
}

.ga-service-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ga-primary);
    line-height: 1.5;
    flex: 1;
}

/* Highlighted text for search matches */
.ga-highlight {
    background: var(--ga-highlight);
    padding: 0.1em 0.25em;
    border-radius: 3px;
    font-weight: inherit;
}

.ga-service-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-inline-start: 1.75rem;
}

.ga-service-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--ga-text-muted);
}

.ga-service-detail-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ga-service-detail-icon img,
.ga-service-detail-icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ga-service-detail-label {
    color: var(--ga-text-light);
}

.ga-service-detail-value {
    font-weight: 600;
    color: var(--ga-primary);
}

/* Service Card Arrow Indicator */
.ga-service-card::after {
    content: '';
    position: absolute;
    top: 50%;
    inset-inline-end: 1rem;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--ga-border-strong);
    border-inline-end: 2px solid var(--ga-border-strong);
    transform: translateY(-50%) rotate(45deg);
    transition: var(--ga-transition);
}

[dir="rtl"] .ga-service-card::after {
    transform: translateY(-50%) rotate(-135deg);
}

.ga-service-card:hover::after {
    border-color: var(--ga-accent);
    inset-inline-end: 0.75rem;
}

/* ============================================
   Mobile Responsive Design
   ============================================ */
@media (max-width: 991.98px) {
    .ga-sidebar-wrapper {
        position: static;
        max-height: none;
        overflow: visible;
        margin-bottom: 1.5rem;
    }

    .ga-main-content {
        padding: 1.5rem 0;
    }

    .ga-header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .ga-group-info {
        justify-content: flex-start;
    }

    .ga-search-group-pill {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .ga-breadcrumb-wrapper {
        padding: 1rem 0;
    }

    .ga-group-title {
        font-size: 1.25rem;
    }

    .ga-header-section {
        padding: 1rem;
    }

    .ga-service-card {
        padding: 1rem;
    }

    .ga-service-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .ga-service-card::after {
        display: none;
    }

    .ga-nav-link {
        padding: 0.75rem;
    }

    .ga-results-header {
        padding: 1rem;
    }

    .ga-results-body {
        padding: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .ga-service-detail {
        width: 100%;
    }

    .ga-search-wrapper {
        flex-wrap: wrap;
    }

    .ga-search-input {
        padding: 0.875rem 0;
    }
}

/* ============================================
   Accessibility Enhancements
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast focus styles */
.ga-nav-link:focus-visible,
.ga-service-card:focus-visible,
.ga-search-input:focus-visible,
.ga-search-clear:focus-visible,
.ga-see-more-btn:focus-visible,
.ga-top-service-item:focus-visible {
    outline: 3px solid var(--ga-accent);
    outline-offset: 2px;
}

/* Skip to content support */
.ga-skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--ga-primary);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    z-index: 9999;
    text-decoration: none;
    font-weight: 600;
}

.ga-skip-link:focus {
    top: 0;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .ga-sidebar-wrapper,
    .ga-search-container,
    .ga-breadcrumb-wrapper {
        display: none;
    }

    .ga-page {
        background: #ffffff;
    }

    .ga-service-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
