/* Main Stylesheet */
body {
    font-family: 'Cairo', sans-serif;
    background-color: #F4F7F6;
    color: #2C2C2C;
    margin: 0;
    padding: 0;
} 

/* --- Global Styles --- */
:root {
    --primary-color: #003366; /* Deep Sapphire Blue */
    --secondary-color: #0077b6; /* A more vibrant blue */
    --accent-color: #FFD700; /* Vibrant Gold */
    --light-gray: #F4F7F6;
    --medium-gray: #4A4A4A;
    --dark-gray: #2C2C2C;
    --primary-gradient: linear-gradient(135deg, #023e8a 0%, #0077b6 50%, #00b4d8 100%);
}

@keyframes animated-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(-45deg, #f0f4f8, #d9e2ec, #bcccdc, #a2b6c9);
    background-size: 400% 400%;
    animation: animated-gradient 15s ease infinite;
    color: var(--medium-gray);
    margin: 0;
    padding: 0;
    font-size: 18px; /* Slightly larger base font */
    line-height: 1.7;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
    padding: 0;
}

/* --- General Button Styles --- */
.btn {
    padding: 10px 22px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* --- Header --- */
.main-header {
    background-color: #ffffff;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}
.main-nav {
    display: flex;
    gap: 25px;
}
.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}
.main-nav a:hover {
    color: var(--primary-color);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* User Dropdown Menu */
.user-menu {
    position: relative;
    padding-bottom: 10px; /* Bridge the gap for hover */
    margin-bottom: -10px; /* Prevent layout shift */
}
.user-menu-name {
    background-color: #f1f5f9;
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    border: none;
    font-family: 'Cairo', sans-serif;
}
.user-menu-name .header-profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}
.user-menu-name:hover {
    background-color: #e2e8f0;
}
.user-menu-name .fa-chevron-down {
    font-size: 0.8em;
    transition: transform 0.3s;
}
.user-menu:hover .user-menu-name .fa-chevron-down {
    transform: rotate(180deg);
}
.user-menu-content {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100%); /* Remove the gap, now bridged by parent padding */
    background-color: white;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    z-index: 100;
    border-radius: 8px;
    padding: 8px 0;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}
.user-menu:hover .user-menu-content {
    display: block;
}
.user-menu-content a {
    color: #333;
    padding: 12px 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
}
.user-menu-content a:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}
.user-menu-content a.logout-link {
    color: #dc3545;
}
.user-menu-content a.logout-link:hover {
    background-color: #dc3545;
    color: white;
}
.user-menu-content i {
    width: 20px;
    text-align: center;
}

/* --- Hamburger and Mobile Menu --- */
.hamburger {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}
.hamburger .bar {
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 5px;
    transition: all 0.3s ease-in-out;
}
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%; /* Start off-screen */
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: right 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    text-align: center;
}
.mobile-menu.is-active {
    right: 0;
}
.mobile-menu a {
    font-size: 2rem;
    margin: 15px 0;
    color: #333;
    text-decoration: none;
    font-weight: bold;
}
.mobile-menu .close-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 3rem;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
}

@media (max-width: 992px) {
    .main-nav, .header-actions .btn {
        display: none;
    }
    .header-actions .user-menu {
        display: none; /* Hide user menu on mobile too, handled in mobile nav */
    }
    .hamburger {
        display: flex;
    }
}
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    header nav.container {
        justify-content: space-between;
    }

    header .main-nav {
        display: none; /* Hide desktop nav */
    }
    
    .action-buttons {
        display: none; /* Hide desktop action buttons */
    }

    .menu-toggle {
        display: block; /* Show hamburger icon */
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero p {
        font-size: 1.3rem;
    }

    .how-it-works-container {
        flex-direction: column;
        align-items: center;
    }

    .step-card {
        width: 80%;
        max-width: 400px;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }
    
    .cta-button {
        font-size: 1.1rem;
        padding: 1rem 2.5rem;
    }
}

/* --- Hero Section --- */
.hero {
    padding: 7rem 0;
    text-align: center;
    color: white;
    background: var(--primary-gradient);
    border-radius: 0 0 50% 50% / 0 0 8% 8%;
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 900;
    color: white; /* Changed to white for gradient background */
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.6rem;
    max-width: 800px;
    margin: 0 auto 2.5rem auto;
    font-weight: 400;
    opacity: 0.9;
}

/* --- Animation Classes --- */
.animate-on-load {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-load.visible {
    opacity: 1;
    transform: translateY(0);
}
/* --- End Animation --- */

.cta-button {
    background-color: var(--accent-color);
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 1.2rem 3.5rem;
    border-radius: 50px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-block;
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

/* --- New Sections General Style --- */
.content-section {
    padding: 4rem 0;
    text-align: center;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #555 !important;
    margin-bottom: 4rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* --- How It Works Section --- */
.how-it-works-container {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    flex-wrap: wrap;
}

.step-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px 0 rgba(0, 51, 102, 0.15);
    width: 30%;
    min-width: 280px;
    text-align: center;
}

.step-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.step-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.step-card p {
    color: #555 !important;
}

/* --- Why Us Section --- */
.why-us-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    text-align: right;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 8px 25px 0 rgba(0, 51, 102, 0.1);
}

.feature-icon {
    font-size: 3rem;
    color: var(--accent-color);
}

.feature-item h3 {
    font-size: 1.4rem;
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.feature-item p {
    color: #555 !important;
}

/* --- Scroll Animation --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2.5rem 0;
    margin-top: 4rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    color: var(--dark-gray);
}

/* --- Marketplace / Products Page --- */
.page-content {
    padding-top: 40px;
    padding-bottom: 40px;
}

.section-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #333; /* Match main theme */
}

.section-subtitle {
    text-align: center;
    font-size: 1.2em;
    color: #666;
    margin-bottom: 40px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

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

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 15px;
    flex-grow: 1;
}

.product-name {
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 0 10px 0;
}

.product-supplier {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 10px;
}

.product-price {
    font-size: 1.1em;
    font-weight: bold;
    color: #0056b3; /* A nice blue for the price */
}

.product-actions {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* General button styles for product cards */
.product-actions .btn-primary, .product-actions .btn-secondary {
    flex: 1;
    text-align: center;
    padding: 10px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.product-actions .btn-primary { background-color: #007bff; color: white; }
.product-actions .btn-primary:hover { background-color: #0056b3; }
.product-actions .btn-secondary { background-color: #f0f0f0; color: #333; }
.product-actions .btn-secondary:hover { background-color: #ddd; }

/* ============================
   Product Details Page
   ============================ */

.product-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .product-details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

.product-gallery .main-image-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.product-gallery .main-image-container img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.product-gallery .thumbnail-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.product-gallery .thumbnail-image {
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s ease;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.product-gallery .thumbnail-image:hover,
.product-gallery .thumbnail-image.active {
    border-color: #007bff;
}

.product-info-details .product-title-details {
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-info-details .product-supplier-details {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 1rem;
}
.product-info-details .product-supplier-details span {
    font-weight: bold;
    color: #007bff;
}

.product-info-details .product-price-details {
    font-size: 2.2rem;
    font-weight: 900;
    color: #28a745;
    margin-bottom: 1.5rem;
}

.product-description-details {
    margin-bottom: 1.5rem;
}

.product-description-details h3 {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.product-quantity-details {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.product-actions-details {
    display: flex;
    gap: 1rem;
}

/* ============================
   About & Contact Us Pages
   ============================ */
.page-header-simple {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
}
.page-header-simple h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    color: #333;
}
.page-header-simple p {
    font-size: 1.2rem;
    color: #555; /* Darker grey for better readability */
    max-width: 600px;
    margin: 0 auto;
}

.page-content > section {
    background-color: #ffffff;
    padding: 2rem 3rem;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    margin-top: -50px; /* Pulls the card up to overlap with header area */
    position: relative;
    z-index: 2;
}



.about-text h2 {
    color: #333; /* Changed from blue */
    margin-top: 0;
}
.about-text p {
    color: #333;
    line-height: 1.8;
}
.about-text ul {
    list-style: none;
    padding: 0;
}
.about-text ul li {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    color: #333;
}
.about-text ul li .fas {
    color: #333; /* Changed from green */
    margin-left: 10px;
}

/* Contact Page */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 992px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.contact-info-block h3, .contact-form-block h3 {
    margin-top: 0;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #333;
}
.contact-info-block p {
    line-height: 1.7;
    color: #333;
}
.contact-list {
    list-style: none;
    padding: 0;
    line-height: 2;
}
.contact-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #333;
}
.contact-list .fas {
    font-size: 1.5rem;
    color: #333; /* Changed from blue */
    width: 30px;
    text-align: center;
}
.contact-form .form-group {
    margin-bottom: 1.5rem;
} 