/* Zaroo.mn Global Stylesheet 
    - Full Safari/iOS Support
    - Modern Glassmorphism Logic
    - High Accessibility Standards
*/

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --accent: #ef4444;
    --dark: #0f172a;
    --text: #334155;
    --light-text: #64748b;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; /* Mobile UX-д зориулсан */
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
    color: var(--text); 
    background: var(--white); 
    line-height: 1.6; 
    overflow-x: hidden; 
    -webkit-font-smoothing: antialiased; /* Текст илүү тод харагдана */
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
a { text-decoration: none; color: inherit; transition: 0.3s; }

/* Buttons */
.btn-primary { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 12px 24px; 
    border-radius: var(--radius-md); 
    font-weight: 600; 
    cursor: pointer; 
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }

.btn-outline { 
    border: 2px solid var(--primary); 
    color: var(--primary); 
    padding: 10px 22px; 
    border-radius: var(--radius-md); 
    font-weight: 600; 
    background: transparent;
}
.btn-outline:hover { background: var(--primary); color: white; }

/* Header - Safari Support Added */
.main-header { 
    padding: 1.2rem 0; 
    background: rgba(255, 255, 255, 0.85); 
    /* Webkit-backdrop-filter is critical for Safari/iOS support */
    -webkit-backdrop-filter: blur(10px); 
    backdrop-filter: blur(10px); 
    z-index: 1000; 
    border-bottom: 1px solid var(--border); 
}
.main-header.sticky { position: sticky; top: 0; }

nav { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.logo span { color: var(--dark); }

.nav-links { display: flex; list-style: none; gap: 2rem; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; color: var(--text); position: relative; }
.nav-links a.active, .nav-links a:hover { color: var(--primary); }

.nav-icon-link { position: relative; font-size: 1.2rem; display: flex; align-items: center; }
.count-badge { 
    position: absolute; 
    top: -8px; 
    right: -10px; 
    background: var(--accent); 
    color: white; 
    font-size: 10px; 
    padding: 2px 6px; 
    border-radius: 20px; 
    font-weight: bold;
}

/* Hero */
.hero { 
    padding: 80px 0; 
    background: radial-gradient(circle at top right, #eef2ff 0%, #fff 50%); 
}
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; align-items: center; gap: 60px; }
.hero-content h1 { font-size: 4rem; line-height: 1.1; margin-bottom: 24px; color: var(--dark); font-weight: 800; letter-spacing: -1px; }
.hero-content h1 span { color: var(--primary); }

.badge-new { 
    background: #e0e7ff; 
    color: var(--primary); 
    padding: 6px 14px; 
    border-radius: 30px; 
    font-weight: 600; 
    font-size: 0.85rem; 
    margin-bottom: 1.5rem; 
    display: inline-block; 
}

/* Search Bar UI */
.search-container { margin-top: 40px; width: 100%; max-width: 600px; }
.search-wrapper { 
    display: flex; 
    background: white; 
    padding: 8px; 
    border-radius: 18px; 
    box-shadow: var(--shadow); 
    border: 1px solid var(--border); 
    align-items: center;
    transition: 0.3s;
}
.search-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); }
.search-wrapper i { margin-left: 15px; color: var(--light-text); }
.search-wrapper input { border: none; flex: 1; padding: 10px 15px; outline: none; font-size: 1rem; color: var(--dark); }

.btn-search { 
    background: var(--dark); 
    color: white; 
    border: none; 
    padding: 12px 28px; 
    border-radius: 14px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: 0.2s;
}
.btn-search:hover { background: #000; }

.quick-tags { margin-top: 15px; display: flex; gap: 12px; font-size: 0.85rem; color: var(--light-text); flex-wrap: wrap; }
.quick-tags a:hover { color: var(--primary); text-decoration: underline; }

/* Section Logic */
.section { padding: 80px 0; }
.section-header h2 { font-size: 2.2rem; color: var(--dark); font-weight: 800; }

/* Grid Layouts */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
.cat-card { 
    background: white; 
    border: 1px solid var(--border); 
    padding: 25px; 
    border-radius: var(--radius-lg); 
    text-align: center; 
    transition: 0.3s ease; 
}
.cat-card:hover { border-color: var(--primary); transform: translateY(-5px); box-shadow: var(--shadow); color: var(--primary); }
.cat-card .icon { font-size: 2.5rem; margin-bottom: 15px; display: block; }

/* Deals UI */
.deals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.deal-card { 
    background: white; 
    border-radius: var(--radius-lg); 
    overflow: hidden; 
    box-shadow: var(--shadow); 
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    border: 1px solid transparent; 
}
.deal-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-hover); border-color: var(--border); }

.card-image { position: relative; height: 220px; width: 100%; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.deal-card:hover .card-image img { transform: scale(1.05); }

.discount-tag { 
    position: absolute; 
    top: 15px; 
    left: 15px; 
    background: var(--accent); 
    color: white; 
    padding: 4px 12px; 
    border-radius: 30px; 
    font-weight: 800; 
    font-size: 0.85rem; 
    z-index: 2;
}

/* Business Section */
.cta-card { 
    background: var(--dark); 
    color: white; 
    padding: 60px; 
    border-radius: 30px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    overflow: hidden; 
    position: relative; 
}
.btn-primary-dark { 
    background: var(--primary); 
    color: white; 
    padding: 14px 32px; 
    border-radius: 12px; 
    font-weight: 700; 
    border: none;
    transition: 0.3s;
}
.btn-primary-dark:hover { background: var(--primary-dark); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3); }

/* Footer */
.main-footer { background: #020617; color: #94a3b8; padding: 80px 0 30px; }
.footer-bottom { 
    margin-top: 60px; 
    padding-top: 30px; 
    border-top: 1px solid #1e293b; 
    display: flex; 
    justify-content: space-between; 
    font-size: 0.85rem; 
    flex-wrap: wrap;
    gap: 15px;
}

/* Responsive Fixes */
@media (max-width: 992px) {
    .hero-content h1 { font-size: 3rem; }
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .search-container { margin: 40px auto 0; }
    .cta-card { flex-direction: column; text-align: center; gap: 30px; padding: 40px 24px; }
    .cta-text { max-width: 100%; }
}

@media (max-width: 600px) {
    .container { padding: 0 16px; }
    .section { padding: 60px 0; }
    .hero-content h1 { font-size: 2.5rem; }
    .search-wrapper { border-radius: 14px; }
    .btn-search { padding: 12px 18px; }
}

/* Layouts */
.deals-layout { display: grid; grid-template-columns: 280px 1fr; gap: 40px; }
.filters-sidebar { padding: 30px; border-radius: var(--radius-lg); height: fit-content; position: sticky; top: 100px; }
.filter-group { margin-top: 25px; }
.filter-group label { display: block; margin-bottom: 10px; font-weight: 600; }
.filter-group select, .filter-group input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border); }

/* Dashboard */
.dashboard-grid { display: grid; grid-template-columns: 250px 1fr; gap: 40px; }
.user-profile { text-align: center; padding-bottom: 30px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.avatar { width: 80px; height: 80px; background: var(--primary); color: white; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 15px; font-size: 1.5rem; font-weight: 800; }
.dash-nav a { display: flex; align-items: center; gap: 15px; padding: 12px 20px; border-radius: 12px; margin-bottom: 5px; font-weight: 500; }
.dash-nav a.active { background: var(--primary-soft); color: var(--primary); }
.dash-nav a.logout { color: var(--danger); margin-top: 50px; }

/* Empty States */
.empty-state { text-align: center; padding: 100px 0; }
.empty-state i { font-size: 4rem; color: var(--border); margin-bottom: 20px; }

/* Auth & Static helper classes */
.auth-container { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
.auth-card { width: 100%; max-width: 400px; padding: 40px; border-radius: var(--radius-lg); }
.w-100 { width: 100%; }
.mt-30 { margin-top: 30px; }
.mb-20 { margin-bottom: 20px; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th, .admin-table td { padding: 15px; border-bottom: 1px solid var(--border); }
.btn-sm { padding: 6px 10px; font-size: 0.8rem; border-radius: 6px; }

/* Contact Specific */
.contact-item { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; font-weight: 500; }

/* Auth Layout */
.auth-bg {
    background: radial-gradient(circle at top left, #eef2ff 0%, #f8fafc 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.auth-card {
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    background: rgba(255, 255, 255, 0.8);
    /* Safari Glass Support */
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.auth-header { text-align: center; margin-bottom: 30px; }
.auth-header h1 { font-size: 1.8rem; font-weight: 800; color: var(--dark); margin-top: 15px; }
.auth-header p { color: var(--light-text); font-size: 0.95rem; }

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    color: var(--light-text);
}

.input-wrapper input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
    font-size: 1rem;
    transition: 0.3s;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.auth-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px; background: var(--border);
    z-index: 1;
}

.auth-divider span {
    background: #fdfdfd;
    padding: 0 15px;
    color: var(--light-text);
    font-size: 0.85rem;
    position: relative;
    z-index: 2;
}

.auth-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 0.95rem;
    color: var(--light-text);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 700;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0;
    font-size: 0.85rem;
}

.checkbox-group input { margin-top: 4px; cursor: pointer; }

/* 404 Error Page Styles */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    text-align: center;
}

.error-content {
    max-width: 600px;
    padding: 40px 20px;
}

.error-code {
    font-size: 8rem;
    line-height: 1;
    color: var(--primary);
    font-weight: 900;
    margin-bottom: 20px;
    /* Текстэн дээрх сүүдэр - илүү гүн харагдуулна */
    text-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

.error-title {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 15px;
}

.error-text {
    font-size: 1.1rem;
    color: var(--light-text);
    margin-bottom: 40px;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .error-code {
        font-size: 5rem;
    }
    .error-title {
        font-size: 1.5rem;
    }
}