/* Ta'luego - Modern Marketplace Styles */

:root {
    --primary-color: #7209b7;
    /* Deep Purple */
    --secondary-color: #3a0ca3;
    /* Royal Indigo */
    --accent-color: #f72585;
    /* Bright Magenta */
    --background-color: #f8f9fa;
    /* Light Gray/White */
    --text-color: #2b2d42;
    --white-glass: rgba(255, 255, 255, 0.85);
    /* Slightly more opaque for better contrast */
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --card-shadow: 0 8px 32px 0 rgba(114, 9, 183, 0.15);
    /* Purple shadow */
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image:
        radial-gradient(at 0% 0%, rgba(114, 9, 183, 0.2) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(247, 37, 133, 0.2) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--white-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.search-bar {
    display: flex;
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
}

.search-bar input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 20px 0 0 20px;
    outline: none;
}

.search-bar button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #560bad;
}

.nav-links .btn {
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    margin-left: 0.5rem;
    transition: all 0.3s;
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background: #560bad;
    border-color: #560bad;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    margin: 2rem 5%;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.btn-lg {
    display: inline-block;
    margin-top: 1rem;
    background: var(--secondary-color);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

.btn-lg:hover {
    transform: scale(1.05);
}

/* Categories */
.categories {
    padding: 2rem 5%;
    text-align: center;
}

.category-list {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.category-card {
    background: var(--white-glass);
    padding: 1.5rem;
    border-radius: 1rem;
    width: 150px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    background: white;
}

.category-card i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    display: block;
}

/* Products Grid */
.products {
    padding: 2rem 5%;
}

.products h3 {
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--white-glass);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s;
    backdrop-filter: blur(5px);
    border: var(--glass-border);
}

.product-card:hover {
    transform: translateY(-5px);
}





.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
}

.product-info {
    padding: 1rem;
}

.product-info h4 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.location {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.btn-sm {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: var(--secondary-color);
    color: white;
}

/* Auth Pages (Login/Register) */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 2rem;
}

.auth-card {
    background: var(--white-glass);
    backdrop-filter: blur(15px);
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 400px;
    border: var(--glass-border);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.input-icon input,
.input-icon select,
.auth-form textarea {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
    color: var(--text-color);
    font-family: inherit;
    appearance: none;
}

.input-icon select {
    cursor: pointer;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 1.2rem;
}

.auth-form textarea {
    padding: 1rem;
    resize: vertical;
    min-height: 100px;
}

.hp-field {
    display: none !important;
    visibility: hidden;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* Fix toggle password position */
.input-icon .toggle-password {
    position: absolute;
    right: 1rem;
    left: auto;
    /* Override left: 1rem from generic rule */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--secondary-color);
    z-index: 10;
}

.input-icon input:focus {
    border-color: var(--primary-color);
    background: white;
}

.btn-block {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:disabled {
    background: #ccc !important;
    border-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed;
    transform: none !important;
    opacity: 0.7;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Password Strength & Captcha */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s, background 0.3s;
}

.captcha-box {
    border: 1px solid #ccc;
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.captcha-box input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.5);
}

.terms-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
}

.terms-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.terms-group label {
    margin-bottom: 0;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.terms-group a {
    color: var(--primary-color);
    text-decoration: underline;
}

.required-star {
    color: var(--accent-color);
    font-weight: bold;
    margin-left: 2px;
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    background: var(--secondary-color);
    color: white;
}

.socials {
    margin-top: 1rem;
}

.socials a {
    color: white;
    font-size: 1.5rem;
    margin: 0 0.5rem;
    transition: color 0.2s;
}

.socials a:hover {
    color: var(--primary-color);
}

/* Product Details Page - Redesign */
.product-detail-container {
    padding: 120px 20px 50px;
    max-width: 1100px;
    margin: 0 auto;
}

.product-detail-card {
    display: flex;
    flex-wrap: wrap;
    background: #ffffff;
    /* Solid white for better readability */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    /* Softer, larger shadow */
    border: none;
    /* Removed glass border */
}

.detail-image-container {
    flex: 1 1 500px;
    /* Base width 500px, grow and shrink */
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 400px;
}

.detail-image-container img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
    /* Shadow on the image itself */
}

.detail-info {
    flex: 1 1 400px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-category {
    align-self: flex-start;
    padding: 0.4rem 1rem;
    background: #e0e7ff;
    color: var(--secondary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    line-height: 1.1;
    font-weight: 800;
}

.detail-price {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.detail-meta {
    margin-bottom: 2rem;
    color: #666;
    font-size: 1rem;
    display: flex;
    gap: 20px;
    align-items: center;
}

.detail-meta i {
    color: var(--secondary-color);
}

.detail-description {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--secondary-color);
}

.detail-description h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #333;
}

.detail-description p {
    line-height: 1.6;
    color: #555;
    font-size: 0.95rem;
}

.seller-badge {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.seller-badge i {
    font-size: 2.5rem;
    color: #cbd5e1;
}

/* Updated Product Card Styles for Index */
.product-card {
    display: flex;
    flex-direction: column;
    background: white;
    /* Solid white */
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle border */
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Force Square Aspect Ratio */
    background: #f8f9fa;
    /* Light gray background for image area */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 1rem;
    /* Padding so image doesn't touch edges */
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure full image visibility inside square */
    background: transparent;
    transition: transform 0.5s ease;
}

.product-card:hover img {
    transform: scale(1.08);
}

.product-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    font-weight: 700;
    /* Limit title to 1 lines */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.location {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-info .btn-sm {
    margin-top: auto;
    width: 100%;
    padding: 0.6rem;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.product-info .btn-sm:hover {
    background: var(--secondary-color);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .product-detail-card {
        flex-direction: column;
    }

    .detail-image-container,
    .detail-info {
        flex: 1 1 100%;
        padding: 20px;
    }

    .detail-image-container {
        min-height: 300px;
    }

    .detail-title {
        font-size: 1.8rem;
    }
}