/* Base Styles */
:root {
    --primary-color: #0F2C25;
    --secondary-color: #5A706C;
    --accent-color: #D23939;
    --light-color: #E9E9E9;
    --neutral-color: #A6AB9F;
    --text-dark: #333;
    --text-light: #fff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-dark);
    background-color: var(--light-color);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1em;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-spinner.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--neutral-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.5rem;
}

.logo-icon {
    background-color: var(--accent-color);
    color: var(--light-color);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
    position: relative;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral-color);
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 30px;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--light-color);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px var(--accent-color);
}

.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--light-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 10;
}

.search-autocomplete.active {
    display: block;
}

.search-autocomplete-item {
    padding: 12px 20px;
    cursor: pointer;
    color: var(--text-dark);
    transition: var(--transition);
}

.search-autocomplete-item:hover {
    background-color: var(--secondary-color);
    color: var(--light-color);
}

.nav ul {
    display: flex;
    list-style: none;
}

.nav ul li {
    margin-left: 20px;
}

.nav ul li a {
    font-weight: 500;
    transition: var(--transition);
    padding: 5px 0;
    position: relative;
}

.nav ul li a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav ul li a:hover:after,
.nav ul li a.active:after {
    width: 100%;
}

.nav ul li a.active {
    color: var(--light-color);
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--light-color);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--primary-color);
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-content {
    padding: 30px;
    position: relative;
    height: 100%;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--light-color);
}

.mobile-menu ul {
    list-style: none;
    margin-top: 40px;
}

.mobile-menu ul li {
    margin-bottom: 20px;
}

.mobile-menu ul li a {
    color: var(--light-color);
    font-size: 1.1rem;
    font-weight: 500;
}

.mobile-menu ul li a.active {
    color: var(--accent-color);
}

/* Hero Section */
.hero {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
}

.hero-search-box {
    position: relative;
    display: flex;
    background-color: var(--light-color);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.hero-search-box i {
    color: var(--neutral-color);
    left: 25px;
}

.hero-search-box input {
    flex: 1;
    padding: 18px 25px 18px 55px;
    border: none;
    background-color: transparent;
    color: var(--text-dark);
    font-size: 1rem;
}

.hero-search-box input:focus {
    box-shadow: none;
    background-color: transparent;
}

.search-btn {
    background-color: var(--accent-color);
    color: var(--light-color);
    padding: 0 30px;
    font-weight: 600;
    transition: var(--transition);
}

.search-btn:hover {
    background-color: darken(var(--accent-color), 10%);
}

/* Sections */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}

.section-subtitle {
    color: var(--secondary-color);
    max-width: 600px;
    margin: 0 auto;
}

.trending-section,
.new-collections,
.featured-categories {
    padding: 80px 0;
}

.trending-section {
    background-color: var(--light-color);
}

.new-collections {
    background-color: #fff;
}

.featured-categories {
    background-color: #f8f8f8;
}

/* Grid Layout */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Design Cards */
.design-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.design-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.card-image {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 44, 37, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
}

.design-card:hover .card-overlay {
    opacity: 1;
}

.view-btn {
    background-color: var(--accent-color);
    color: var(--light-color);
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
}

.view-btn:hover {
    background-color: darken(var(--accent-color), 10%);
    transform: translateY(-2px);
}

.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.card-description {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 15px;
    flex: 1;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background-color: var(--light-color);
    color: var(--secondary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Filter Tabs */
.filter-container {
    margin-bottom: 30px;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-tab {
    background-color: var(--light-color);
    color: var(--secondary-color);
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 500;
    transition: var(--transition);
}

.filter-tab:hover,
.filter-tab.active {
    background-color: var(--primary-color);
    color: var(--light-color);
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.category-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--light-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    font-size: 1.5rem;
}

.category-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.category-count {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 50px;
}

.load-more-btn {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
}

.load-more-btn:hover {
    background-color: darken(var(--primary-color), 10%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 60px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-description {
    opacity: 0.8;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}

.footer-title {
    font-size: 1.1rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    opacity: 0.8;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent-color);
    padding-left: 5px;
}

.footer-newsletter-text {
    opacity: 0.8;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.newsletter-form {
    display: flex;
}

.newsletter-form input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
}

.newsletter-form input:focus {
    outline: none;
}

.subscribe-btn {
    background-color: var(--accent-color);
    color: var(--light-color);
    padding: 0 20px;
    border-radius: 0 4px 4px 0;
    font-weight: 500;
    transition: var(--transition);
}

.subscribe-btn:hover {
    background-color: darken(var(--accent-color), 10%);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright {
    opacity: 0.7;
    font-size: 0.85rem;
}

.footer-legal {
    display: flex;
    gap: 20px;
}

.footer-legal a {
    opacity: 0.7;
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-legal a:hover {
    opacity: 1;
    color: var(--accent-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.modal-content {
    position: relative;
    z-index: 2;
    background-color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    z-index: 3;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background-color: var(--accent-color);
    transform: rotate(90deg);
}

.modal-image-container {
    flex: 1;
    min-height: 400px;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image-container img {
    max-height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.modal-content-container {
    width: 350px;
    padding: 40px;
    overflow-y: auto;
}

.modal-content-container h2 {
    margin-bottom: 15px;
}

.modal-content-container p {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.modal-tags .tag {
    background-color: var(--light-color);
    color: var(--secondary-color);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.save-btn,
.download-btn {
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.save-btn {
    background-color: var(--light-color);
    color: var(--secondary-color);
}

.save-btn:hover {
    background-color: var(--secondary-color);
    color: var(--light-color);
}

.download-btn {
    background-color: var(--accent-color);
    color: var(--light-color);
}

.download-btn:hover {
    background-color: darken(var(--accent-color), 10%);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .modal-content {
        flex-direction: column;
        max-height: 90vh;
    }
    
    .modal-image-container {
        min-height: 300px;
    }
    
    .modal-content-container {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .logo {
        order: 1;
    }
    
    .mobile-menu-btn {
        order: 2;
        display: block;
        margin-left: auto;
    }
    
    .nav {
        order: 3;
        width: 100%;
        margin-top: 20px;
        display: none;
    }
    
    .nav.active {
        display: block;
    }
    
    .nav ul {
        flex-direction: column;
    }
    
    .nav ul li {
        margin-left: 0;
        margin-bottom: 15px;
    }
    
    .search-container {
        order: 2;
        width: 100%;
        margin: 20px 0 0;
        max-width: 100%;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-search-box input {
        padding: 15px 20px 15px 50px;
    }
    
    .search-btn {
        padding: 0 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-legal {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .hero {
        padding: 80px 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-search-box {
        flex-direction: column;
        border-radius: 12px;
    }
    
    .hero-search-box input {
        border-radius: 12px 12px 0 0;
        padding: 15px 20px;
    }
    
    .search-btn {
        border-radius: 0 0 12px 12px;
        padding: 12px 20px;
    }
}