/* Utoraz Market Frontend Styles */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --border-color: #e2e8f0;
    --text-color: #334155;
    --text-light: #64748b;
    --white: #ffffff;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo span {
    color: var(--dark-color);
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
}

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

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

.market-emojis {
    display: inline-block;
    animation: bounce 1s ease-in-out infinite;
}

.market-emojis:first-child {
    animation-delay: 0s;
}

.market-emojis:last-child {
    animation-delay: 0.5s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Search Bar */
.search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

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

/* Hero Banner */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.hero-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--white);
    color: var(--primary-color);
    border-radius: var(--radius);
    font-weight: 600;
    transition: transform 0.3s;
}

.hero-btn:hover {
    transform: translateY(-2px);
}

/* Section */
.section {
    padding: 60px 0;
}

.section-title {
    font-size: 28px;
    color: var(--dark-color);
    margin-bottom: 10px;
    text-align: center;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 40px;
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.category-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-color);
}

/* Listings Grid */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.listing-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.listing-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

.listing-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.listing-content {
    padding: 15px;
}

.listing-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.listing-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.listing-location {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
}

.listing-description {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Detail Page */
.detail-header {
    background: var(--white);
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-content {
    padding: 40px 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.detail-gallery {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

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

.thumbnail {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity 0.3s;
}

.thumbnail:hover {
    opacity: 0.8;
}

.thumbnail.active {
    border: 2px solid var(--primary-color);
}

.detail-info {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.detail-title {
    font-size: 28px;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.detail-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
}

.detail-description {
    margin-bottom: 25px;
}

.detail-description h3 {
    font-size: 18px;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.detail-description p {
    color: var(--text-color);
    line-height: 1.8;
}

.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.3s;
}

.contact-btn.call {
    background: var(--success-color);
    color: var(--white);
}

.contact-btn.telegram {
    background: #0088cc;
    color: var(--white);
}

.contact-btn.whatsapp {
    background: #25d366;
    color: var(--white);
}

.contact-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.share-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.share-title {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-color);
    color: var(--text-light);
    transition: all 0.3s;
}

.share-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Related Listings */
.related-section {
    padding: 40px 0;
    background: var(--white);
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: var(--white);
    padding: 40px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.footer-title {
    font-size: 18px;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

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

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

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

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: #475569;
}

/* Responsive */
@media (max-width: 1024px) {
    .listings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: var(--shadow-md);
        padding: 20px;
        gap: 10px;
        z-index: 1000;
    }
    
    .nav.active {
        display: flex;
    }
    
    .nav-link {
        padding: 12px 16px;
        border-radius: var(--radius);
    }
    
    .search-bar {
        order: 3;
        width: 100%;
        margin: 10px 0 0;
        max-width: none;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .main-image {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .listings-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .detail-title {
        font-size: 22px;
    }
    
    .detail-price {
        font-size: 24px;
    }
}
