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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header Styles - Mobile First */
.top-bar {
    background: #f0f0f0;
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.language-selector select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    min-width: 60px;
}

.user-menu {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.user-menu-item {
    color: #0056b3;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.user-menu-item i {
    font-size: 12px;
}

@media (max-width: 480px) {
    .menu-text {
        display: none;
    }
    
    .user-menu-item {
        padding: 6px 10px;
    }
    
    .user-menu-item i {
        font-size: 14px;
        margin: 0;
    }
}

.main-header {
    background: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #0056b3;
    gap: 8px;
}

.logo-img {
    height: 35px;
    width: auto;
}

.logo-text {
    font-size: 18px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .logo-text {
        font-size: 16px;
    }
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #0056b3;
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: #fff;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        padding-top: 60px;
    }
    
    nav.active {
        left: 0;
    }
    
    nav ul {
        flex-direction: column;
        padding: 20px;
    }
    
    nav ul li {
        margin: 0 0 15px 0;
        width: 100%;
    }
    
    nav ul li a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px;
        background: #f8f9fa;
        border-radius: 8px;
    }
    
    .nav-text {
        display: inline !important;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        padding-left: 30px;
        display: none;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
}

@media (min-width: 769px) {
    nav ul {
        display: flex;
        list-style: none;
        gap: 20px;
    }
    
    nav ul li a {
        color: #333;
        text-decoration: none;
        font-weight: 500;
        font-size: 15px;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    
    nav ul li a:hover {
        color: #0056b3;
    }
    
    .post-ad-btn {
        background: #0056b3;
        color: #fff !important;
        padding: 8px 15px;
        border-radius: 4px;
    }
    
    .post-ad-btn:hover {
        background: #003d82;
    }
    
    .dropdown {
        position: relative;
    }
    
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        min-width: 200px;
        display: none;
        z-index: 1000;
        padding: 10px 0;
    }
    
    .dropdown:hover .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu li {
        margin: 0;
    }
    
    .dropdown-menu a {
        padding: 10px 20px;
        display: block;
    }
}

/* Hero Section - Mobile First */
.hero-section {
    background: linear-gradient(135deg, #0056b3, #003d82);
    color: #fff;
    padding: 40px 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 24px;
    margin-bottom: 20px;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 36px;
        margin-bottom: 30px;
    }
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.search-form input,
.search-form select,
.search-form button {
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

@media (min-width: 768px) {
    .search-form {
        flex-direction: row;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .search-form input {
        flex: 2;
    }
    
    .search-form select {
        flex: 1;
    }
    
    .search-form button {
        flex: 0.5;
    }
}

.search-form button {
    background: #ffc107;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.search-form button:hover {
    background: #e0a800;
}

/* Ads Grid - Mobile First */
.ads-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 20px 0;
}

@media (min-width: 480px) {
    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .ads-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .ads-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .ads-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.ad-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ad-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ad-card.featured {
    border: 2px solid #ffc107;
    position: relative;
}

.ad-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
}

.ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffc107;
    color: #333;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 1;
}

.ad-details {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ad-details h3 {
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
}

.ad-details h3 a {
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-details h3 a:hover {
    color: #0056b3;
}

.ad-category {
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ad-category i {
    color: #0056b3;
    font-size: 10px;
}

.ad-price {
    font-weight: bold;
    color: #28a745;
    font-size: 16px;
    margin: 5px 0;
}

.ad-location {
    color: #666;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
}

.ad-location i {
    color: #0056b3;
    font-size: 10px;
}

/* Pagination - Mobile First */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
}

.pagination-info {
    width: 100%;
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    order: -1;
}

.pagination-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.page-link:hover {
    background: #f0f0f0;
    border-color: #0056b3;
}

.page-link.active {
    background: #0056b3;
    color: #fff;
    border-color: #0056b3;
}

.page-link.prev-next {
    font-size: 12px;
}

.page-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #666;
}

@media (min-width: 768px) {
    .pagination {
        flex-direction: row;
        gap: 15px;
    }
    
    .pagination-info {
        width: auto;
        order: 0;
        margin-bottom: 0;
    }
}

/* Forms - Mobile First */
.auth-form,
.post-ad-form {
    max-width: 100%;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .auth-form {
        max-width: 450px;
        padding: 30px;
    }
    
    .post-ad-form {
        max-width: 800px;
        padding: 30px;
    }
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    margin-bottom: 20px;
    color: #0056b3;
    font-size: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0,86,179,0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #666;
    font-size: 12px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

@media (min-width: 768px) {
    .btn {
        width: auto;
        padding: 10px 25px;
    }
}

.btn-primary {
    background: #0056b3;
    color: #fff;
}

.btn-primary:hover {
    background: #003d82;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .form-actions {
        flex-direction: row;
        gap: 15px;
    }
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Captcha Styles */
.captcha-group {
    margin-bottom: 20px;
}

.captcha-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

@media (min-width: 768px) {
    .captcha-container {
        flex-direction: row;
        align-items: center;
    }
}

.captcha-container img {
    border: 1px solid #ddd;
    border-radius: 8px;
    height: 50px;
    width: 150px;
    object-fit: cover;
}

.btn-refresh {
    padding: 10px 15px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
}

@media (min-width: 768px) {
    .btn-refresh {
        width: auto;
    }
}

.btn-refresh:hover {
    background: #545b62;
}

/* Password Strength */
.password-strength {
    font-size: 12px;
    margin-top: 5px;
    min-height: 18px;
}

/* Image Preview */
.image-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

@media (min-width: 768px) {
    .image-preview {
        grid-template-columns: repeat(5, 1fr);
    }
}

.preview-image {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-image .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Promotion Grid */
.promotion-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 15px;
}

@media (min-width: 768px) {
    .promotion-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.promotion-card {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
}

.promotion-card:hover {
    border-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,86,179,0.1);
}

.promotion-card input[type="radio"] {
    display: none;
}

.promotion-card input[type="radio"]:checked + label {
    border-color: #0056b3;
}

.promotion-card label {
    cursor: pointer;
    display: block;
}

.promotion-card h4 {
    color: #0056b3;
    margin-bottom: 10px;
    font-size: 16px;
}

.promotion-card .price {
    font-size: 20px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 10px;
}

.promotion-card ul {
    margin-top: 10px;
    padding-left: 20px;
    color: #666;
    font-size: 13px;
}

.promotion-card li {
    margin-bottom: 5px;
}

/* Ad Details Page - Mobile First */
.ad-details-page {
    padding: 20px 0;
}

.ad-header {
    margin-bottom: 20px;
}

.ad-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .ad-header h1 {
        font-size: 32px;
    }
}

.ad-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.ad-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ad-meta i {
    color: #0056b3;
    width: 16px;
}

.promoted-badge {
    background: #ffc107;
    color: #333;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
}

/* Image Gallery */
.ad-gallery {
    margin-bottom: 25px;
}

.main-image {
    width: 100%;
    aspect-ratio: 16/9;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 10px;
    background: #f0f0f0;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (min-width: 768px) {
    .thumbnail-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

.thumbnail {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.3s;
    background: #f0f0f0;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #0056b3;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ad Content Layout */
.ad-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

@media (min-width: 992px) {
    .ad-content {
        grid-template-columns: 2fr 1fr;
    }
}

.ad-description {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.ad-description h3 {
    color: #0056b3;
    margin: 20px 0 10px;
    font-size: 18px;
}

.ad-description h3:first-child {
    margin-top: 0;
}

.ad-description p {
    color: #555;
    line-height: 1.7;
    white-space: pre-line;
}

.price-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.price {
    font-size: 28px;
    font-weight: bold;
    color: #28a745;
}

/* Sidebar */
.ad-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-info {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.contact-info h3 {
    color: #0056b3;
    margin-bottom: 15px;
    font-size: 18px;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    word-break: break-word;
}

.contact-info-item i {
    width: 20px;
    color: #0056b3;
    font-size: 16px;
}

.contact-info-item a {
    color: #0056b3;
    text-decoration: none;
}

.contact-info-item a:hover {
    text-decoration: underline;
}

.phone-display {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.phone-number {
    font-size: 16px;
    font-weight: bold;
    color: #28a745;
}

.btn-show-phone {
    padding: 6px 12px;
    background: #0056b3;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-show-phone:hover {
    background: #003d82;
}

.ad-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .ad-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Modal for Image Zoom */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: hidden;
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    background: rgba(0,0,0,0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #ffc107;
    background: rgba(0,0,0,0.5);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

@media (min-width: 768px) {
    .modal-nav {
        padding: 0 20px;
    }
}

.modal-nav button {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .modal-nav button {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
}

.modal-nav button:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Footer - Mobile First */
footer {
    background: #333;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-section h3 {
    margin-bottom: 15px;
    color: #ffc107;
    font-size: 16px;
}

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

.footer-section ul li {
    margin-bottom: 8px;
    font-size: 13px;
}

.footer-section ul li a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

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

.social-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-links a {
    color: #fff;
    font-size: 20px;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #ffc107;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    font-size: 12px;
}