@font-face {
    font-family: 'Vazir';
    src: url('/assets/fonts/vazir/Vazir-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('/assets/fonts/vazir/Vazir-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('/assets/fonts/vazir/Vazir-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('/assets/fonts/vazir/Vazir-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #4a89dc;
    --primary-dark: #3b70c2;
    --primary-light: #e8f4ff;
    --secondary: #3ba0dc;
    --success: #37bc9b;
    --danger: #e74c3c;
    --warning: #f6bb42;
    --light: #f5f7fa;
    --lighter: #f9fafc;
    --dark: #2c3e50;
    --darker: #1a252f;
    --text: #333;
    --text-light: #666;
    --text-lighter: #999;
    --border: #e1e5eb;
    --border-light: #eef1f5;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Base Styles - Mobile First */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazir', sans-serif;
    color: var(--text);
    background-color: var(--lighter);
    line-height: 1.6;
    font-size: 16px;
}

.container {
    width: 100%;
    padding: 0 15px;
    margin: 0 auto;
}

/* Header Styles */
.main-header {
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.logo-container {
    text-align: center;
}

.logo-container h1 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 0.3rem;
    font-weight: 700;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-light);
}

.main-nav {
    display: none;
    width: 100%;
    text-align: center;
}

.main-nav.active {
    display: block;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
    display: inline-block;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-link.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

.mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
}

/* Search Engine Styles */
.search-engine-container {
    margin: 1.5rem 0;
    width: 100%;
}

.search-engine-form {
    width: 100%;
}

.search-engine-input-group {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border);
    background: white;
}

.search-engine-input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(74, 137, 220, 0.2);
    border-color: var(--primary);
}

.search-engine-input-container {
    position: relative;
    width: 100%;
}

#search-engine-input {
    width: 100%;
    padding: 0.9rem 1.3rem;
    border: none;
    font-size: 1rem;
    outline: none;
    background: transparent;
    color: var(--text);
}

.search-engine-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    border: 1px solid var(--border);
    border-top: none;
}

.search-engine-suggestions[role="listbox"] {
    display: block;
}

.search-engine-suggestions div {
    padding: 0.8rem 1.3rem;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.search-engine-suggestions div:hover {
    background: var(--light);
    color: var(--primary);
}

.search-engine-dropdown {
    position: relative;
    background: var(--light);
    border-top: 1px solid var(--border);
    width: 100%;
}

#search-engine-provider {
    appearance: none;
    background: transparent;
    border: none;
    padding: 0.9rem 2rem 0.9rem 1rem;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    width: 100%;
    color: var(--text);
    font-family: 'Vazir';
}

.search-engine-dropdown-arrow {
    position: absolute;
    top: 50%;
    left: 0.8rem;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-light);
    font-size: 0.8rem;
}

.search-engine-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    font-family: 'Vazir';
    width: 100%;
}

.search-engine-button:hover {
    background: var(--primary-dark);
}

.search-engine-button i {
    font-size: 1rem;
}

.search-engine-button-text {
    display: inline-block;
}

/* Main Container */
.main-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem auto;
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.sidebar-widget {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.widget-title {
    font-size: 1rem;
    margin-bottom: 1.2rem;
    color: var(--dark);
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--border-light);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget-title i {
    color: var(--primary);
}

/* Visitor Counter Widget */
.visitor-counter {
    padding: 1.5rem;
}

.visitor-counter .widget-title {
    margin-bottom: 1.5rem;
}

.counter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.counter-item {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.counter-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.stat-text {
    flex-grow: 1;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.2rem;
    color: var(--dark);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
}

.stat-progress {
    height: 4px;
    background: rgba(0,0,0,0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 1s ease;
}

/* Color coding for different stats */
.today-visits {
    border-color: var(--primary);
}
.today-visits .stat-icon {
    background: rgba(74, 137, 220, 0.1);
    color: var(--primary);
}
.today-visits .progress-bar {
    background: var(--primary);
}

.today-unique {
    border-color: var(--success);
}
.today-unique .stat-icon {
    background: rgba(55, 188, 155, 0.1);
    color: var(--success);
}
.today-unique .progress-bar {
    background: var(--success);
}

.week-visits {
    border-color: var(--warning);
}
.week-visits .stat-icon {
    background: rgba(246, 187, 66, 0.1);
    color: var(--warning);
}
.week-visits .progress-bar {
    background: var(--warning);
}

.week-unique {
    border-color: var(--danger);
}
.week-unique .stat-icon {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
}
.week-unique .progress-bar {
    background: var(--danger);
}

/* Ad Banner Styles */
.ad-banner {
    margin-bottom: 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.ad-banner:last-child {
    margin-bottom: 0;
}

.ad-banner img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
    border-radius: var(--radius);
}

.ad-banner:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.ad-banner:hover img {
    transform: scale(1.02);
}

/* Content Area Styles */
.content-area {
    width: 100%;
}

/* Ads Grid Styles */
.ads-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.ad-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
    position: relative;
}

.ad-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.ad-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.ad-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ad-card:hover .ad-image {
    transform: scale(1.03);
}

.ad-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.ad-type {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    z-index: 2;
}

.ad-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ad-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ad-title {
    font-size: 1.1rem;
    margin-bottom: 0;
    color: var(--dark);
    line-height: 1.4;
    font-weight: 700;
}

.ad-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
    display: block;
}

.ad-title a:hover {
    color: var(--primary);
}

.ad-salary {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
    align-self: flex-start;
}

.ad-meta-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ad-company, .ad-provider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text);
}

.ad-company i {
    color: var(--primary);
}

.ad-provider i {
    color: var(--secondary);
}

.ad-meta {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
    background: var(--light);
    padding: 0.3rem 0.6rem;
    border-radius: 1rem;
    flex-grow: 1;
    justify-content: center;
    min-width: calc(50% - 0.5rem);
    box-sizing: border-box;
}

.meta-item i {
    margin-left: 0.3rem;
    font-size: 0.9rem;
    color: var(--primary);
}

.ad-description {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* -webkit-line-clamp: 3; */
}

.ad-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.ad-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stat-badge {
    background: var(--light);
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.stat-badge i {
    font-size: 0.8rem;
}

.ad-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition);
    align-self: flex-start;
}

.ad-link:hover {
    color: var(--primary-dark);
}

.ad-link i {
    font-size: 0.8rem;
}

/* No Ads Styles */
.no-ads {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.no-ads i {
    font-size: 2rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.no-ads p {
    color: var(--text-light);
    font-size: 1rem;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.5rem 0.9rem;
    background: white;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    min-width: 36px;
    justify-content: center;
}

.page-link:hover, .page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-link i {
    font-size: 0.8rem;
}

.ellipsis {
    padding: 0.5rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
}

/* Footer Styles */
.main-footer {
    background: var(--dark);
    color: white;
    padding: 2rem 0 0;
    margin-top: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section {
    margin-bottom: 1.5rem;
    text-align: center;
}

.footer-section h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.8rem;
    font-weight: 700;
}

.footer-section h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 50px;
    height: 3px;
    background: var(--primary);
}

.footer-logo h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: white;
}

.footer-logo p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.footer-about {
    opacity: 0.8;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.8);
    margin-bottom: 1.5rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
    display: block;
    padding: 0.3rem 0;
    font-size: 0.9rem;
}

.footer-section ul li a:hover {
    color: white;
}

.contact-info li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.contact-info i {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    font-size: 1.1rem;
    transition: var(--transition);
    color: white;
}

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

.footer-bottom {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.copyright {
    font-size: 0.85rem;
    opacity: 0.7;
    color: rgba(255,255,255,0.7);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

/* Tablet Styles (min-width: 768px) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }

    .logo-container {
        text-align: left;
    }

    .main-nav {
        display: block;
    }

    .nav-list {
        flex-direction: row;
        gap: 1.5rem;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .search-engine-input-group {
        flex-direction: row;
    }

    .search-engine-dropdown {
        border-top: none;
        border-left: 1px solid var(--border);
        width: auto;
        min-width: 150px;
    }

    .search-engine-button {
        width: auto;
        padding: 0 1.5rem;
    }

    .counter-grid {
        grid-template-columns: 1fr 1fr;
    }

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

    .ad-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

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

    .footer-section {
        text-align: left;
    }

    .footer-section h3:after {
        right: 0;
        transform: none;
    }

    .social-links {
        justify-content: flex-start;
    }

    .contact-info li {
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.8rem;
    }
}

/* Desktop Styles (min-width: 992px) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }

    .main-container {
        flex-direction: row;
    }

    .sidebar {
        width: 280px;
        flex-shrink: 0;
        display: block;
    }

    .content-area {
        flex-grow: 1;
        min-width: 0;
    }

    .ads-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .meta-item {
        min-width: auto;
    }

    .ad-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* Large Desktop Styles (min-width: 1200px) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .ads-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}