:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --secondary: #7209b7;
    --accent: #f72585;
    --success: #4cc9f0;
    --warning: #f8961e;
    --dark: #212529;
    --light: #f8f9fa;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fb;
    color: #333;
    line-height: 1.6;
}

/* Hero Section */
.hero-section {
    background: var(--gradient);
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: heroPulse 8s ease-in-out infinite;
}

@keyframes heroPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 40px;
}

/* Search Box */
.search-box-wrapper {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.search-form .form-select,
.search-form .form-control {
    border: none;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-form .form-control:focus,
.search-form .form-select:focus {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.btn-warning {
    border-radius: 12px;
    padding: 14px 30px;
    font-weight: 700;
    transition: all 0.3s;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(248,150,30,0.4);
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.autocomplete-item {
    padding: 12px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.autocomplete-item:hover {
    background: #f0f4ff;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

/* Stats Section */
.stats-section {
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

.stat-item {
    background: #fff;
    border-radius: 16px;
    padding: 30px 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: #fff;
    font-size: 1.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

/* Section Headers */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.section-subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* Country Cards */
.country-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: all 0.3s;
    text-align: center;
}

.country-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    background: var(--primary);
}

.country-card:hover .country-name,
.country-card:hover .country-count {
    color: #fff;
}

.country-flag {
    font-size: 2rem;
    margin-bottom: 8px;
}

.country-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
    transition: color 0.3s;
}

.country-count {
    font-size: 0.75rem;
    color: #999;
    transition: color 0.3s;
}

/* Step Cards */
.step-card {
    padding: 30px 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.step-card:hover {
    transform: translateY(-5px);
}

.step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

/* Search Results Page */
.results-header {
    background: var(--gradient);
    padding: 40px 0;
    color: #fff;
}

.result-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: all 0.3s;
    border-left: 4px solid var(--primary);
}

.result-card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transform: translateX(3px);
}

.result-postal {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.result-city {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

.result-detail {
    color: #666;
    font-size: 0.9rem;
}

.result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.result-actions .btn {
    border-radius: 8px;
    font-size: 0.85rem;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.share-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s;
}

.share-btn:hover { transform: scale(1.1); color: #fff; }
.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.linkedin { background: #0077b5; }
.share-btn.email { background: #666; }

/* Ad Containers */
.ad-container {
    text-align: center;
}

.ad-single {
    margin: 5px;
    border-radius: 8px;
    overflow: hidden;
}

.ad-single img {
    max-height: 120px;
    width: auto;
    border-radius: 8px;
}

.ad-text-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

.ad-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
}

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    color: #fff;
    padding: 15px 0;
    z-index: 9999;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
}

.cookie-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-text i {
    font-size: 1.5rem;
    color: var(--warning);
}

.cookie-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Donate Buttons */
.donate-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-donate {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
}

.paypal-btn {
    background: #0070ba;
    color: #fff;
}

.coffee-btn {
    background: #ff813f;
    color: #fff;
}

.btn-donate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    color: #fff;
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 10px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
}

.social-icons a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

/* Footer */
.footer {
    background: #1a1a2e !important;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #fff;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    transition: all 0.3s;
    z-index: 1000;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.back-to-top.show {
    display: flex;
}

/* Language Dropdown */
.lang-dropdown {
    max-height: 400px;
    overflow-y: auto;
    min-width: 180px;
}

/* Pagination */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 3px;
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* Admin Styles */
.admin-sidebar {
    min-height: calc(100vh - 56px);
    background: #1a1a2e;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 10px;
    transition: all 0.3s;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.admin-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

/* Page Content */
.page-content {
    max-width: 900px;
    margin: 0 auto;
}

.page-content h2 {
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary);
}

.page-content h3 {
    color: var(--primary-dark);
    margin-top: 25px;
}

.page-content ul {
    padding-left: 20px;
}

.page-content li {
    margin-bottom: 8px;
}

/* Contact Form */
.contact-form .form-control {
    border-radius: 10px;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s;
}

.contact-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: none;
}

/* Tip Box */
.tip-box {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    border-left: 4px solid var(--success);
    padding: 20px;
    border-radius: 0 12px 12px 0;
    margin: 20px 0;
}

.tip-box h5 {
    color: #00695c;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero-section { padding: 50px 0 80px; }
    .stat-number { font-size: 1.5rem; }
    .section-title { font-size: 1.5rem; }
    .country-card { padding: 15px 8px; }
    .country-flag { font-size: 1.5rem; }
    .country-name { font-size: 0.75rem; }
    .cookie-content { flex-direction: column; text-align: center; }
    .donate-buttons { flex-direction: column; align-items: center; }
}

@media (max-width: 576px) {
    .hero-title { font-size: 1.6rem; }
    .search-form .row { flex-direction: column; }
    .result-card { padding: 15px; }
}

/* Print Styles */
@media print {
    .navbar, .footer, .back-to-top, .cookie-consent, .ad-container, .share-buttons, .donate-buttons { display: none !important; }
    .hero-section { padding: 20px 0; background: #fff; color: #000; }
    .hero-title { color: #000; }
    .result-card { box-shadow: none; border: 1px solid #ddd; }
}

/* RTL Support */
[dir="rtl"] body { font-family: 'Segoe UI', Tahoma, 'Noto Sans Arabic', 'Noto Sans Hindi', Arial, sans-serif; }
[dir="rtl"] .hero-title { direction: rtl; }
[dir="rtl"] .hero-subtitle { direction: rtl; }
[dir="rtl"] .result-card { border-left: none; border-right: 4px solid var(--primary); }
[dir="rtl"] .result-card:hover { transform: translateX(-3px); }
[dir="rtl"] .search-form .form-select,
[dir="rtl"] .search-form .form-control { text-align: right; }
[dir="rtl"] .tip-box { border-left: none; border-right: 4px solid var(--success); }
[dir="rtl"] .navbar-brand { direction: rtl; }
[dir="rtl"] .footer-links { padding-right: 0; padding-left: 20px; }
[dir="rtl"] .dropdown-menu { text-align: right; }
[dir="rtl"] .page-content h2 { border-bottom: none; border-right: 3px solid var(--primary); padding-right: 15px; }
[dir="rtl"] .result-postal { direction: ltr; display: inline-block; }
[dir="rtl"] .autocomplete-item { text-align: right; }
[dir="rtl"] .stat-label { direction: rtl; }

/* Flag Emoji Fallback - use images when emoji not supported */
.flag-icon {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    margin-right: 4px;
    border-radius: 2px;
}

/* Topbar Donate Buttons */
.topbar-donate {
    display: flex;
    gap: 6px;
    align-items: center;
}
.topbar-donate .btn {
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}
.topbar-donate .btn-paypal {
    background: #0070ba;
    color: #fff;
    border: none;
}
.topbar-donate .btn-coffee {
    background: #ff813f;
    color: #fff;
    border: none;
}
.topbar-donate .btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* Social Share in Header */
.header-share {
    display: flex;
    gap: 5px;
    align-items: center;
}
.header-share a {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-size: 0.8rem;
    transition: transform 0.2s;
}
.header-share a:hover { transform: scale(1.15); }
.header-share .share-fb { background: #1877f2; }
.header-share .share-tw { background: #1da1f2; }
.header-share .share-wa { background: #25d366; }
.header-share .share-li { background: #0077b5; }
.header-share .share-tg { background: #0088cc; }

/* AdSense Ready Ad Containers */
.adsense-container {
    text-align: center;
    margin: 15px 0;
    min-height: 90px;
    background: #f9f9f9;
    border: 1px dashed #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.adsense-container img {
    max-width: 100%;
    height: auto;
}

/* Favicon Styles */
.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
}
.site-logo-icon {
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 900;
    font-size: 1.1rem;
}
