/**
 * Custom Styles for Textile Wholesale Landing Page
 *
 * CSS (Cascading Style Sheets) controls the visual presentation of HTML elements.
 * This file extends Bootstrap's default styles with custom branding and layouts.
 */

/* ===== ROOT VARIABLES ===== */
/* CSS Variables allow us to reuse colors and values throughout the stylesheet */
:root {
    --primary-color: #0d6efd;      /* Main brand color (blue) */
    --secondary-color: #dc3545;     /* Accent color (red) */
    --dark-color: #212529;          /* Text color */
    --light-bg: #f8f9fa;            /* Light background */
    --transition: all 0.3s ease;    /* Standard animation speed */
}

/* ===== GLOBAL STYLES ===== */
/* Apply smooth scrolling when clicking anchor links */
html {
    scroll-behavior: smooth;
}

/* Set default font and ensure the page uses full viewport height */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
    line-height: 1.6;
}

/* ===== NAVIGATION STYLES ===== */
/* Enhance the navigation bar appearance */
.navbar {
    transition: var(--transition);
}

/* When navbar links are hovered, show visual feedback */
.navbar-nav .nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

/* Underline effect on hover using CSS pseudo-element */
.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 60%;
}

/* ===== HERO SECTION ===== */
/* The hero is the first impression - make it impactful */
.hero-section {
    position: relative;
    padding: 2rem 0;
    overflow: hidden;
}

/* Minimum height utility class */
.min-vh-75 {
    min-height: 75vh;
}

/* Container for the hero image with special positioning */
.hero-image-container {
    position: relative;
    z-index: 2;
}

/* The main product image in the hero */
.hero-image {
    position: relative;
    z-index: 3;
    max-width: 500px;
    animation: float 3s ease-in-out infinite;
}

/* Floating animation - makes the image gently move up and down */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Decorative circle behind the hero image */
.hero-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    border-radius: 50%;
    z-index: 1;
    opacity: 0.8;
}

/* Decorative pattern in the background */
.hero-bg-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(13, 110, 253, 0.03) 10px, rgba(13, 110, 253, 0.03) 20px);
    z-index: 0;
}

/* ===== FEATURE CARDS ===== */
/* Cards that highlight key benefits */
.feature-card {
    transition: var(--transition);
    border: 1px solid transparent;
}

/* Lift effect on hover - engages users */
.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(13, 110, 253, 0.2) !important;
}

/* ===== BUTTONS ===== */
/* Enhanced button styles for better visual hierarchy */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Button hover effects */
.btn-primary:hover {
    background-color: #0a58ca;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

/* ===== PRODUCT CARDS ===== */
/* Grid layout for products */
.product-card {
    height: 100%;
    transition: var(--transition);
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
}

/* Product image container - maintains aspect ratio */
.product-card img {
    height: 250px;
    object-fit: cover;
    width: 100%;
    transition: var(--transition);
}

.product-card:hover img {
    transform: scale(1.05);
}

/* Product card buttons - smaller and more compact */
.card-body .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.813rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

/* Ensure card images on products page maintain aspect ratio */
#productGrid .card-img-top {
    height: 220px;
    object-fit: cover;
    width: 100%;
}

/* Card body layout improvements */
#productGrid .card-body {
    padding: 1rem;
}

#productGrid .card-title {
    font-size: 1rem;
    font-weight: 600;
    min-height: 2.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#productGrid .card-text {
    font-size: 0.875rem;
    min-height: 3rem;
}

/* Price and action button container */
#productGrid .mt-auto {
    margin-top: auto !important;
    padding-top: 0.5rem;
}

/* ===== FORMS ===== */
/* Enhanced form styling for better user experience */
.form-control,
.form-select {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    transition: var(--transition);
}

/* Focus state - when user clicks into an input */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

/* ===== SECTIONS ===== */
/* Consistent spacing for all major sections */
section {
    scroll-margin-top: 80px; /* Accounts for sticky header when scrolling to anchors */
}

/* ===== FOOTER ===== */
/* Footer styling for brand consistency */
footer a:hover {
    color: var(--primary-color) !important;
    transition: var(--transition);
}

.social-links a {
    transition: var(--transition);
    display: inline-block;
}

.social-links a:hover {
    transform: translateY(-3px);
}

/* ===== UTILITY CLASSES ===== */
/* Helper classes for common patterns */

/* Shadow variations */
.shadow-custom {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Text shadow for better readability on images */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Background overlay - useful for text over images */
.bg-overlay {
    position: relative;
}

.bg-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.bg-overlay > * {
    position: relative;
    z-index: 2;
}

/* ===== RESPONSIVE DESIGN ===== */
/* Media queries adjust styles for different screen sizes */

/* Tablets and below */
@media (max-width: 991px) {
    .hero-section {
        text-align: center;
    }

    .hero-circle {
        width: 400px;
        height: 400px;
    }

    .display-3 {
        font-size: 2.5rem;
    }
}

/* Mobile phones */
@media (max-width: 576px) {
    .display-3 {
        font-size: 2rem;
    }

    .display-5 {
        font-size: 1.75rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Stack buttons vertically on small screens */
    .d-flex.gap-3 {
        flex-direction: column !important;
    }

    .d-flex.gap-3 .btn {
        width: 100%;
    }

    /* Product card adjustments for mobile */
    #productGrid .card-img-top {
        height: 180px;
    }

    #productGrid .card-body .btn-sm {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    #productGrid .card-title {
        font-size: 0.95rem;
        min-height: 2rem;
    }
}

/* ===== ANIMATIONS ===== */
/* Fade in animation for content as page loads */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animation to sections (can be triggered via JavaScript) */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Loading spinner customization */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ===== ACCESSIBILITY ===== */
/* Ensure sufficient contrast and focus indicators for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-switcher {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.lang-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #6c757d;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.5px;
    min-width: 40px;
}

.lang-btn:hover {
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.lang-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
}

@media (max-width: 991px) {
    .lang-switcher {
        margin: 0.5rem 0;
    }
}
