/* General Body Styles */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: #121212;
    color: #ffffff;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: rgba(31, 31, 31, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.1s ease-in-out;
}

.header-hidden {
    transform: translateY(-100%);
}

.header-left .logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.header-center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    padding: 0 1rem;
}

.header-center .search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #2a2a2a;
    padding: 0.75rem 1.5rem;
    width: 100%;
    max-width: 1000px;
    border-radius: 50px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.1rem;
    outline: none;
    width: 100%;
}

.search-bar .search-btn, .search-bar .close-btn {
    background: transparent;
    border: none;
    color: #a0a0a0;
    cursor: pointer;
    font-size: 1.2rem;
}

.search-bar .close-btn {
    display: none;
}

#search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #2a2a2a;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
}

.suggestion-item {
    padding: 0.75rem 1.5rem;
    color: #ffffff;
    cursor: pointer;
}

.suggestion-item:hover {
    background-color: #3a3a3a;
}

/* Main Content Styles */
main {
    padding: 2rem;
}

/* Product Grid Styles */
#product-grid, #related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.product-card {
    text-decoration: none;
    color: inherit;
}

.product-card-thumbnail img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    border-radius: 10px;
}

.product-card-details {
    display: flex;
    align-items: center;
    padding: 1rem 0;
}

.product-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 1rem;
}

.product-card-meta {
    flex: 1;
    min-width: 0;
}

.product-card-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    white-space: normal;
}

.product-card-creator {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin: 0.25rem 0 0;
}

/* Product Page Layout */
.product-page-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    max-width: 1600px;
    margin: auto;
}

.main-content h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.main-content, .sidebar {
    padding: 1rem;
}

.sidebar {
    display: block;
}

.related-products-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

#related-products-grid {
    grid-template-columns: 1fr;
}


/* Product Image */
.product-image-container {
    width: 100%;
    margin-bottom: 1.5rem;
}

.product-image {
    width: 100%;
    border-radius: 12px;
}

/* Product Actions */
.product-actions-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.creator-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.creator-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 1rem;
}

.creator-meta {
    display: flex;
    flex-direction: column;
}

.creator-name {
    font-size: 1rem;
    font-weight: 500;
}

.subscribe-button {
    background-color: #ffffff;
    color: #000000;
    border: none;
    border-radius: 20px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    margin-left: 1rem;
    text-decoration: none;
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-button {
    background-color: #2a2a2a;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.critique-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Product Details Card */
.product-details-card {
    background-color: #2a2a2a;
    padding: 1.5rem;
    border-radius: 20px;
    padding-bottom: 3rem;
}

/* Product Score and Pros/Cons */
.product-score-container {
    text-align: left;
    margin-bottom: 2rem;
}

.product-score {
    font-size: 4rem;
    font-weight: bold;
    color: #4CAF50;
}

.score-label {
    font-size: 1rem;
    color: #a0a0a0;
}

.product-pros-cons {
    display: block;
}

.pros-container, .cons-container {
    flex: 1;
}

.pros-container h2, .cons-container h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #4CAF50;
}

.cons-container h2 {
    color: #f44336;
}

.pros-container ul, .cons-container ul {
    list-style-type: none;
    padding: 0;
}

.pros-container li, .cons-container li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.pros-container li::before, .cons-container li::before {
    content: '+';
    position: absolute;
    left: 0;
    color: #4CAF50;
}

.cons-container li::before {
    content: '-';
    color: #f44336;
}

/* Product Sources */
.product-sources {
    margin-top: 2rem;
}

.product-sources h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.product-sources ul {
    list-style-type: none;
    padding: 0;
}

.product-sources li a {
    color: #ffffff;
    text-decoration: underline;
}

/* Mobile Search */
.mobile-search-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.back-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}


/* Responsive Styles */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    main {
        padding: 1rem 0;
    }

    .header-center {
        display: none;
    }

    .mobile-search-btn {
        display: block;
    }

    header.search-active {
        padding: 1rem 0;
    }

    header.search-active .header-left, 
    header.search-active .header-right,
    header.search-active .mobile-search-btn {
        display: none;
    }

    header.search-active .header-center {
        display: flex;
        width: 100%;
    }

    header.search-active .header-center .search-bar {
        width: 100%;
        max-width: none;
        border-radius: 50px;
    }

    header.search-active .back-btn {
        display: block;
        padding: 0 1rem;
    }

    .product-page-layout {
        grid-template-columns: 1fr;
    }

    .product-page-layout .main-content {
        padding: 1rem 0;
    }

    .product-image-container {
        margin-bottom: 1rem;
    }

    .product-image {
        border-radius: 0;
    }

    .product-page-layout h1,
    .product-actions-container,
    .critique-title,
    .product-details-card {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .sidebar {
        padding: 1rem 0;
    }

    .related-products-title {
        padding: 0 1rem;
    }

    #product-grid, #related-products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-card-thumbnail img {
        border-radius: 0;
    }

    .product-card-details {
        padding: 1rem;
    }

    .product-actions-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .creator-info {
        flex-grow: 0;
    }

    .subscribe-button {
        margin-left: auto;
    }

    .action-buttons {
        margin-top: 1rem;
    }

    .product-details-card {
        margin-top: 1rem;
    }

}
