/* assets/css/regions.css */

/* ==================== HERO ==================== */
.regions-hero {
    position: relative;
    background: var(--text);
    padding: 64px 0 72px;
    overflow: hidden;
}

.regions-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 80% at 5% 55%, rgba(255, 107, 53, .2) 0%, transparent 65%),
        radial-gradient(ellipse 50% 70% at 90% 20%, rgba(0, 184, 148, .14) 0%, transparent 60%),
        radial-gradient(ellipse 38% 52% at 50% 96%, rgba(251, 191, 36, .07) 0%, transparent 55%);
    pointer-events: none;
}

.regions-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: .6;
}

.regions-hero .container {
    position: relative;
    z-index: 2;
}

.hero-breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .8rem;
    margin-bottom: 22px;
    color: rgba(255, 255, 255, .5);
    flex-wrap: wrap;
}

.hero-breadcrumb a {
    color: rgba(255, 255, 255, .6);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color .2s;
    text-decoration: none;
}

.hero-breadcrumb a:hover {
    color: #fff;
}

.hero-breadcrumb .fa-chevron-right {
    font-size: .6rem;
    opacity: .4;
}

.hero-breadcrumb span {
    color: rgba(255, 255, 255, .8);
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #fdba74;
    background: rgba(255, 107, 53, .18);
    border: 1px solid rgba(255, 107, 53, .3);
    padding: 5px 14px;
    border-radius: 30px;
    margin-bottom: 16px;
}

.hero-eyebrow i {
    animation: globeSpin 6s linear infinite;
}

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

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 14px;
    line-height: 1.12;
    letter-spacing: -.03em;
}

.hero-title span {
    background: linear-gradient(90deg, #fdba74, #86efac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, .6);
    margin: 0;
    line-height: 1.7;
    max-width: 640px;
}

.hero-stats-row {
    display: flex;
    gap: 0;
    margin-top: 44px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 800px;
}

.hero-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 12px;
    border-right: 1px solid rgba(255, 255, 255, .08);
    transition: background .2s;
}

.hero-stat:last-child {
    border-right: none;
}

.hero-stat:hover {
    background: rgba(255, 255, 255, .08);
}

.hero-stat i {
    font-size: .8rem;
    color: rgba(255, 255, 255, .45);
}

.hero-stat-num {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.hero-stat-lbl {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255, 255, 255, .45);
}

/* ==================== TOOLBAR ==================== */
.regions-toolbar {
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 0;
    position: sticky;
    top: 68px;
    z-index: 200;
    box-shadow: var(--shadow-xs);
}

.toolbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Search */
.regions-search {
    flex: 1;
    min-width: 220px;
    max-width: 380px;
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
}

.search-field>i {
    position: absolute;
    left: 13px;
    font-size: .85rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-field input {
    width: 100%;
    padding: 9px 13px 9px 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: .875rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg-soft);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.search-field input:focus {
    border-color: var(--primary);
    background: var(--bg);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, .1);
}

.search-clear {
    position: absolute;
    right: 10px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-muted);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: .7rem;
    text-decoration: none;
    transition: all .2s;
}

.search-clear:hover {
    background: var(--primary);
    color: #fff;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-wrap: wrap;
}

.results-label {
    font-size: .82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.results-label strong {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--primary);
    font-size: .97rem;
}

/* Sort tabs */
.sort-tabs {
    display: flex;
    gap: 4px;
}

.sort-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    background: var(--bg-soft);
    color: var(--text-muted) !important;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all .18s;
    white-space: nowrap;
}

.sort-tab:hover {
    border-color: var(--primary);
    color: var(--primary) !important;
}

.sort-tab.active {
    background: var(--primary);
    color: #fff !important;
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(255, 107, 53, .25);
}

.sort-tab i {
    font-size: .68rem;
}

/* View toggle */
.view-toggle {
    display: flex;
    gap: 4px;
}

.view-btn {
    width: 34px;
    height: 34px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: .8rem;
    transition: all .18s;
}

.view-btn:hover,
.view-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ==================== BODY ==================== */
.regions-body {
    background: var(--bg-soft);
    padding: 44px 0 96px;
}

/* ==================== LAYOUT ==================== */
.rg-layout {
    display: grid;
    grid-template-columns: 1fr 288px;
    gap: 32px;
    align-items: start;
}

.rg-main {
    min-width: 0;
}

/* ==================== SIDEBAR ==================== */
.rg-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rg-widget {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 18px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xs);
}

.rg-widget-title {
    font-family: var(--font-display);
    font-size: .92rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 7px;
    position: relative;
}

.rg-widget-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 22px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.rg-widget-title i {
    color: var(--primary);
    font-size: .8rem;
}

/* Stats list */
.rg-stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rg-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .8rem;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-light);
}

.rg-stat-row:last-child {
    border-bottom: none;
}

.rg-stat-lbl {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.rg-stat-lbl i {
    color: var(--primary);
    font-size: .7rem;
    width: 14px;
}

.rg-stat-row strong {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text);
    font-size: .9rem;
}

/* Tip widget */
.rg-widget-tip {
    background: linear-gradient(135deg, rgba(255, 107, 53, .06), rgba(0, 184, 148, .04));
    border-color: rgba(255, 107, 53, .15);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.rg-tip-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 107, 53, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
    font-size: .85rem;
}

.rg-tip-text {
    font-size: .78rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Explore nav */
.rg-explore-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rg-explore-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    text-decoration: none !important;
    color: var(--text) !important;
    font-size: .8rem;
    font-weight: 500;
    transition: all .2s;
    border: 1px solid transparent;
}

.rg-explore-link:hover {
    border-color: var(--primary);
    color: var(--primary) !important;
    background: var(--bg);
}

.rg-explore-link > i:first-child {
    color: var(--primary);
    font-size: .75rem;
    width: 14px;
}

.rg-explore-arrow {
    margin-left: auto;
    font-size: .65rem;
    color: var(--text-muted);
    transition: transform .2s;
}

.rg-explore-link:hover .rg-explore-arrow {
    transform: translateX(3px);
    color: var(--primary);
}

/* Sidebar ads */
.rg-sidebar-ad {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    background: var(--bg-muted);
    transition: box-shadow .2s;
}

.rg-sidebar-ad:hover {
    box-shadow: var(--shadow-md);
}

.rg-sidebar-ad img {
    width: 100%;
    display: block;
    transition: transform .4s;
}

.rg-sidebar-ad:hover img {
    transform: scale(1.03);
}

/* ==================== BANNER AD ==================== */
.rg-banner-ad {
    margin-bottom: 28px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    background: var(--bg-muted);
    transition: box-shadow .2s;
}

.rg-banner-ad:hover {
    box-shadow: var(--shadow-md);
}

.rg-banner-ad img {
    width: 100%;
    display: block;
    max-height: 100px;
    object-fit: cover;
}

.regions-inline-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 18px;
}

.regions-inline-label::before {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* ==================== FEATURED REGION ==================== */
.featured-region-wrap {
    margin-bottom: 52px;
}

.featured-region-label {
    margin-bottom: 14px;
}

.featured-region-card {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--bg);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all .32s var(--ease-spring);
}

.featured-region-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: transparent;
}

.fr-media {
    position: relative;
    overflow: hidden;
    background: var(--bg-muted);
    min-height: 340px;
}

.fr-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s;
}

.featured-region-card:hover .fr-media img {
    transform: scale(1.05);
}

.fr-media-placeholder {
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 107, 53, .15), rgba(0, 184, 148, .1));
    font-size: 6rem;
    color: rgba(255, 107, 53, .3);
}

.fr-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent 60%, rgba(0, 0, 0, .08));
}

.fr-body {
    padding: 44px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fr-eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .75rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 12px;
}

.fr-eyebrow i {
    font-size: .7rem;
}

.fr-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 14px;
    letter-spacing: -.02em;
}

.fr-desc {
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.72;
    margin: 0 0 20px;
}

.fr-stats {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: .78rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.fr-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fr-stats i {
    color: var(--primary);
    font-size: .72rem;
}

.fr-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: var(--primary);
    color: #fff !important;
    border-radius: 50px;
    font-weight: 700;
    font-size: .875rem;
    text-decoration: none !important;
    transition: all .22s;
    align-self: flex-start;
    box-shadow: 0 4px 14px rgba(255, 107, 53, .28);
}

.fr-cta:hover {
    background: var(--primary-dark, #e85a22);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(255, 107, 53, .35);
}

.fr-cta i {
    font-size: .72rem;
    transition: transform .2s;
}

.fr-cta:hover i {
    transform: translateX(4px);
}

/* ==================== REGIONS GRID ==================== */
.regions-grid-head {
    margin-bottom: 4px;
}

.regions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}

/* LIST VIEW */
.regions-grid.list-view {
    grid-template-columns: 1fr;
    gap: 14px;
}

.regions-grid.list-view a.region-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    flex-direction: row;
}

.regions-grid.list-view .rc-media {
    height: auto;
    min-height: 140px;
}

.regions-grid.list-view .rc-body {
    padding: 20px 22px;
}

/* Card — now <a> element */
.region-card {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit !important;
    background: var(--bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xs);
    transition: all .3s var(--ease-spring);
    position: relative;
}

.region-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s;
    z-index: 1;
}

.region-card:hover::before {
    transform: scaleX(1);
}

.region-card:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

/* rc-link kept for JS compatibility, no longer a nested <a> */
.rc-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rc-media {
    position: relative;
    height: 165px;
    overflow: hidden;
    background: var(--bg-muted);
    flex-shrink: 0;
}

.rc-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

.region-card:hover .rc-media img {
    transform: scale(1.07);
}

.rc-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 107, 53, .08), rgba(0, 184, 148, .06));
    font-size: 3rem;
    color: rgba(255, 107, 53, .3);
    transition: transform .5s;
}

.region-card:hover .rc-media-placeholder {
    transform: scale(1.07);
}

.rc-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .38) 0%, transparent 55%);
    opacity: 0;
    transition: opacity .3s;
}

.region-card:hover .rc-overlay {
    opacity: 1;
}

.rc-activity-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: .62rem;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
    backdrop-filter: blur(5px);
}

.rc-body {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rc-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 5px;
    letter-spacing: -.01em;
    transition: color .2s;
}

.region-card:hover .rc-name {
    color: var(--primary);
}

.rc-chef-lieu {
    font-size: .72rem;
    color: var(--text-muted);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rc-chef-lieu i {
    color: var(--primary);
    font-size: .65rem;
}

.rc-desc {
    font-size: .77rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mini stats */
.rc-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: .68rem;
    color: var(--text-muted);
    padding: 8px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 10px;
}

.rc-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rc-stats i {
    color: var(--primary);
    font-size: .6rem;
}

/* Geo row */
.rc-geo {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: .68rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.rc-geo span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rc-geo i {
    color: var(--secondary);
    font-size: .62rem;
}

.rc-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary) !important;
    font-weight: 600;
    font-size: .8rem;
    transition: gap .2s;
    margin-top: auto;
}

.rc-cta i {
    font-size: .7rem;
    transition: transform .2s;
}

.region-card:hover .rc-cta {
    gap: 10px;
}

.region-card:hover .rc-cta i {
    transform: translateX(3px);
}

/* ==================== EMPTY STATE ==================== */
.regions-empty {
    text-align: center;
    padding: 72px 24px;
    margin-bottom: 48px;
}

.regions-empty i {
    font-size: 3.5rem;
    color: var(--border);
    display: block;
    margin-bottom: 18px;
}

.regions-empty h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
}

.regions-empty p {
    font-size: .9rem;
    color: var(--text-muted);
    margin: 0;
}

.regions-empty a {
    color: var(--primary);
    text-decoration: underline;
}

/* ==================== PAGINATION ==================== */
.regions-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: .85rem;
    font-weight: 600;
    color: var(--text) !important;
    text-decoration: none !important;
    transition: all .2s;
}

.pag-btn:hover {
    border-color: var(--primary);
    color: var(--primary) !important;
}

.pag-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(255, 107, 53, .25);
}

.pag-prev,
.pag-next {
    font-size: .75rem;
}

/* Animations */
.fade-in {
    animation: fadeUp .55s var(--ease-out) both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1199px) {
    .rg-layout {
        grid-template-columns: 1fr 260px;
        gap: 24px;
    }

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

    .featured-region-card {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 991px) {
    .regions-hero {
        padding: 48px 0 56px;
    }

    .rg-layout {
        grid-template-columns: 1fr;
    }

    .rg-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

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

    .featured-region-card {
        grid-template-columns: 1fr;
    }

    .fr-media {
        min-height: 260px;
    }

    .hero-stats-row {
        max-width: none;
        flex-wrap: wrap;
    }

    .hero-stat {
        min-width: 100px;
        flex: 1;
    }

    .toolbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .regions-search {
        max-width: none;
    }

    .toolbar-right {
        margin-left: 0;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .regions-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .fr-body {
        padding: 28px 24px;
    }

    .fr-title {
        font-size: 1.5rem;
    }

    .sort-tabs {
        flex-wrap: wrap;
    }

    .rg-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: clamp(1.9rem, 7vw, 2.8rem);
    }

    .regions-grid.list-view a.region-card {
        grid-template-columns: 1fr;
    }

    .regions-grid.list-view .rc-media {
        height: 160px;
    }
}