/* ==========================================================================
   LOYNOVA PREMIUM DESIGN SYSTEM
   Theme: Navy Blue & Vibrant Orange
   Version: 2.0 (Enterprise)
   ========================================================================== */

:root {
    /* --- LOYNOVA BRAND PALETTE --- */
    --primary-color: #132BD3;
    /* Deep Cobalt */
    --primary-glow: rgba(19, 43, 211, 0.6);
    --secondary-color: #0a1a80;
    /* Darker Blue */

    --accent-color: #F26142;
    /* Vibrant Orange */
    --accent-glow: rgba(242, 97, 66, 0.6);

    /* --- BACKGROUND SYSTEM --- */
    --bg-dark: #050510;
    /* Almost Black */
    --bg-mesh-1: #0a1a80;
    --bg-mesh-2: #2e0545;

    /* --- TYPOGRAPHY --- */
    --text-white: #ffffff;
    --text-gray: #a0a0b0;

    /* --- GLASSMORPHISM --- */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);

    /* --- ANIMATION --- */
    --transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);

    /* --- FONT STACKS --- */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* --- RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ==========================================================================
   LAYOUT MODULES
   ========================================================================== */

/* --- DYNAMIC BACKGROUND ATMOSPHERE --- */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #0d1126 0%, #000000 100%);
}

.bg-glow-1,
.bg-glow-2 {
    position: fixed;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    z-index: -1;
    pointer-events: none;
    animation: floatBlob 20s infinite alternate ease-in-out;
}

.bg-glow-1 {
    top: -20%;
    left: -10%;
    background: var(--primary-color);
}

.bg-glow-2 {
    bottom: -20%;
    right: -10%;
    background: var(--secondary-color);
    animation-delay: -5s;
}

@keyframes floatBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* --- PRIMARY APPLICATION WRAPPER --- */
.app-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ==========================================================================
   LOYNOVA BRANDING & NAVIGATION
   ========================================================================== */

.glass-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
    background: transparent;
    border: none;
    margin-bottom: 20px;
    position: relative;
    z-index: 100;
}

.nav-logo-img {
    height: 80px;
    cursor: pointer;
    transition: var(--transition);
    filter: drop-shadow(0 0 15px rgba(19, 43, 211, 0.5));
}

.nav-logo-img:hover {
    filter: drop-shadow(0 0 30px var(--primary-color));
    transform: scale(1.1);
}

/* ==========================================================================
   UI COMPONENTS
   ========================================================================== */

/* --- HERO & IDENTITY --- */
.hero-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.hero-text h1 {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -2px;
    line-height: 1.1;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 30%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    color: var(--text-gray);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* --- SEARCH SUBSYSTEM --- */
.search-wrapper {
    display: flex;
    justify-content: center;
}

.glass-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 15px 25px;
    border-radius: 50px;
    width: 100%;
    max-width: 500px;
    transition: var(--transition);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.glass-search:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 30px var(--primary-glow);
    transform: scale(1.02);
}

.glass-search svg {
    color: var(--text-gray);
    margin-right: 15px;
}

.glass-search input {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
    font-family: var(--font-body);
}

.search-clear-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-gray);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    margin-left: 10px;
}

.search-clear-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

/* --- METRICS DASHBOARD --- */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 60px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.glass-panel.clickable-stat {
    cursor: pointer;
}

.glass-panel.clickable-stat:active {
    transform: scale(0.98);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.stat-icon.project-glow {
    color: var(--primary-color);
    box-shadow: 0 0 20px rgba(19, 43, 211, 0.2);
}

.stat-icon.merchant-glow {
    color: var(--accent-color);
    box-shadow: 0 0 20px rgba(242, 97, 66, 0.2);
}

.stat-icon.branch-glow {
    color: #00d2ff;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================================================================
   CONTENT MATRICES
   ========================================================================== */

.content-area {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 500px;
}

.landing-grid,
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* --- CARD ARCHITECTURE --- */
.landing-card,
.card {
    background: rgba(20, 20, 35, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.landing-card {
    align-items: center;
    text-align: center;
}

.landing-card:hover,
.card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary-color);
    background: rgba(20, 20, 40, 0.8);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.card-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.landing-card:hover .card-glow {
    opacity: 0.15;
}

.landing-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    transition: transform 0.4s ease;
}

.landing-card:hover .landing-icon {
    transform: scale(1.2) rotate(5deg);
}

.landing-card h3,
.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.landing-card p,
.card-meta {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- DYNAMIC DIRECTORY STYLING --- */

.hidden {
    display: none !important;
}

#directory-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-gray);
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: var(--transition);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* --- ASSET REPRESENTATION --- */
.card-logo-container {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    background: #ffffff;
    padding: 0;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover .card-logo-container {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 30px var(--primary-glow);
}

.card-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card:hover .card-logo {
    transform: scale(1.05);
}

.card-logo-placeholder {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    font-family: var(--font-heading);
}

.card-badge {
    background: #252843;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-top: 10px;
    color: #f26142;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.card-rewards-multi {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.reward-pill {
    font-size: 0.7rem;
    color: #f26142;
    font-weight: 700;
    display: flex;
    align-items: center;
    background: #1a1523;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #3d2f3b;
    white-space: nowrap;
}

.reward-pill.more {
    color: #5c64c7;
    background: #141630;
    border-color: #27284f;
}

/* --- NAVIGATION DEPTH (BREADCRUMBS) --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.crumb {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-gray);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.crumb:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.crumb:last-child {
    background: var(--primary-color);
    color: white;
    cursor: default;
}

/* ==========================================================================
   OVERLAY SYSTEMS (MODALS)
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-glass {
    background: #151525;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    /* Restrict max height */
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 0;
    /* Move padding to a scrollable inner container if possible, or adjust */
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-content-wrapper {
    padding: 40px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 24px;
}

/* Custom Scrollbar for Modal Content */
.modal-content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.modal-content-wrapper::-webkit-scrollbar-track {
    background: transparent;
    margin: 20px 0;
    /* Keeps scrollbar away from very edges */
}

.modal-content-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.modal-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-overlay.active .modal-glass {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: white;
    transform: rotate(90deg);
}

.modal-title {
    font-family: var(--font-heading);
    color: white;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.modal-badge {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.modal-description {
    color: var(--text-gray);
    line-height: 1.6;
    margin: 20px 0 30px;
}

/* --- ACTION COMPONENTS --- */
.btn-glow {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(19, 43, 211, 0.3);
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(19, 43, 211, 0.5);
    background: #2040FF;
}

/* ==========================================================================
   RESPONSIVE OVERRIDES
   ========================================================================== */

@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 3rem;
    }

    .stats-dashboard {
        grid-template-columns: 1fr;
    }

    .glass-nav {
        padding: 15px;
    }

    .landing-grid {
        grid-template-columns: 1fr;
    }
}

/* --- MOTION REVEAL ENGINE --- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

/* --- SEARCH RESULTS ENHANCEMENTS --- */
.search-header-results {
    margin-bottom: 40px;
    text-align: left;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.search-header-results h3 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.search-header-results p {
    color: var(--text-gray);
    font-size: 1.1rem;
}

.no-results {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--glass-border);
    border-radius: 24px;
    padding: 60px;
    text-align: center;
    margin-top: 40px;
}

.no-results .landing-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3 {
    margin-bottom: 10px;
    color: var(--text-white);
}

.no-results p {
    color: var(--text-gray);
    max-width: 400px;
    margin: 0 auto;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 10px;
    padding: 0;
}

.btn-text:hover {
    color: var(--accent-color);
}