/* css/style.css - Public-facing styles */

:root {
    --primary-color: #ff3d3d;
    /* Neon Red */
    --secondary-color: #050505;
    /* Ultra Dark Black */
    --surface-color: rgba(255, 255, 255, 0.02);
    --text-color: #d4d4d4;
    --text-primary: #ffffff;
    --text-secondary: #737373;
    --card-bg: rgba(20, 20, 20, 0.4);
    /* Glass Base */
    --border-color: rgba(255, 255, 255, 0.06);
    --font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --radius: 16px;
    /* Modern smooth radius */
    --shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
    --glow: 0 0 25px rgba(255, 61, 61, 0.3);
}

body {
    font-family: var(--font-family);
    margin: 0;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.5;
    font-size: 13px;
    /* Reduced base font size for "small" aesthetic */
    background-image: radial-gradient(circle at 50% -20%, #1a0505, #000000);
    background-attachment: fixed;
}

body.no-scroll {
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1400px;
    /* Wider container */
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

/* Hero Section */
.hero {
    padding: 5rem 1rem;
    text-align: center;
    position: relative;
    min-height: 50vh;
    /* Compact hero */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-ambient {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255, 61, 61, 0.1) 0%, transparent 70%);
    filter: blur(60px);
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 700px;
}

/* Removed old pseudo-element */
.secondary-hero::before {
    content: '';
    display: none;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.4), var(--secondary-color));
    z-index: 1;
}

.hero h2 {
    font-size: 3rem;
    /* Sleek, tight typography */
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #ffffff, #888888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInDown 1s ease-in-out;
    text-shadow: none;
}

.hero p {
    font-size: 0.95rem;
    /* Small, crisp text */
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 2rem auto;
    animation: fadeInUp 1s ease-in-out;
}

.hero-btn {
    padding: 10px 30px;
    /* Smaller button */
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 50px;
    background: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 1s ease-in-out 0.2s;
    animation-fill-mode: backwards;
    /* Start animation even if delayed */
    transition: all 0.3s ease;
}

.hero-btn:hover {
    background: var(--primary-color-dark);
}

.secondary-hero {
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-top: 0px solid var(--border-color);
    border-bottom: 0px solid var(--border-color);
    min-height: min-content;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 4rem;
    box-shadow: none;
}

.secondary-hero h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    z-index: 2;
    margin-bottom: 0.5rem;
    text-shadow: none;
}

.secondary-hero p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 450px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.secondary-hero-btn {
    margin-top: 2rem;
    position: relative;
    z-index: 2;
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.secondary-hero-btn:hover {
    background: var(--primary-color);
    color: white;
}

.view-all-container {
    text-align: center;
    margin-top: 3rem;
}

main {
    padding: 0 0rem;
    max-width: 1400px;
    margin: 0 auto;
}

#products-section h2 {
    text-align: center;
    margin-top: 4rem;
    font-size: 2rem;
    font-weight: 800;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 300px));
    justify-content: center;
    gap: 1.2rem;
    margin-top: 4rem;
    margin-bottom: 3rem;
}

/* User Auth Header Section */
.user-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.user-icon {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

#logout-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

#logout-link:hover {
    color: var(--primary-color);
}

.login-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
    background-color: var(--primary-color);
    border: none;
    color: white;
}

.login-btn:hover {
    background-color: var(--primary-color-dark);
}

@media (max-width: 768px) {
    .login-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}
/* =================================== */
/* == Product Detail Page Styles == */
/* =================================== */

#product-detail-page {
    padding-top: 7rem;
    padding-bottom: 3rem;
    min-height: 60vh;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: flex-start;
}

.product-image-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.product-image-gallery .product-main-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    background-color: var(--surface-color);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: opacity 0.3s ease;
    object-fit: cover;
}

.product-thumbnails-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
    justify-content: center;
    width: 100%;
}

.product-thumbnail {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    opacity: 0.6;
    background-color: rgba(0,0,0,0.2);
}

.product-thumbnail:hover, .product-thumbnail.active {
    border-color: var(--primary-color);
    opacity: 1;
}

.product-info-panel .product-title {
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
    color: var(--text-primary);
}

.product-info-panel .product-price {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.product-description h2 {
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.product-description p {
    color: var(--text-secondary);
}

.product-actions {
    margin-top: 2rem;
}

.cta-button {
    margin-top: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 16px 32px;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background-color: #c62828;
    /* Darker Red */
}

.cta-button .material-icons-outlined {
    font-size: 24px;
}

/* Loading and Error States */
.loading-spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 4rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-message {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 4rem 0;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #c62828;
    /* Darker Red */
}

.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Form transition animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-50px);
    }
}

#login-form,
#signup-form {
    animation-duration: 0.4s;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
}

.form-enter {
    animation-name: slideIn;
}

.form-exit {
    animation-name: slideOut;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-info-panel .product-title {
        font-size: 2rem;
    }
}

/* =================================== */
/* == About Page Styles == */
/* =================================== */

.page-hero {
    text-align: center;
    padding: 4rem 1rem;
    background-color: var(--surface-color);
    border-radius: var(--radius);
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.page-hero h1 {
    font-size: 2.8rem;
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
}

.page-hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.about-content .about-section {
    margin-bottom: 3rem;
}

.about-section h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.about-section p {
    color: var(--text-secondary);
    max-width: 800px;
    line-height: 1.7;
}

/* New Team Section Styles */
.team-section {
    padding: 60px 0;
    text-align: center;
}

.section-title {
    color: white;
    font-size: 2rem;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 10px;
}

.team-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    /* Essential for mobile stacking */
}

.team-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    width: 280px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.team-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.image-wrapper {
    margin-bottom: 20px;
}

.image-wrapper img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(229, 57, 53, 0.4);
    object-fit: cover;
}

.team-card h3 {
    color: white;
    margin: 0;
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.team-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* =================================== */
/* == Community Stats Section == */
/* =================================== */

.community-stats-section {
    background: transparent;
    color: #fff;
    padding: 40px 0px;
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.community-stats-section h2 {
    font-size: 2rem;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    color: #f0f0f0;
    font-weight: 800;
}

/* Adds a stylish underline to the heading */
.community-stats-section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

.stats-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    /* Ensures responsiveness on smaller screens */
}

.stat-box {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    min-width: 200px;
    /* Smaller width */
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    /* Important for the hover effect */
}

.stat-box:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* A subtle glow effect on hover */
.stat-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 61, 61, 0.1), transparent 50%);
    transition: opacity 0.5s ease;
    opacity: 0;
    pointer-events: none;
}

.stat-box:hover::before {
    opacity: 1;
}

.stat-icon {
    margin: 0 auto 15px auto;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
    width: 45px;
    /* Smaller icon container */
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.stat-icon svg {
    width: 20px;
    /* Smaller SVG */
    height: 20px;
    stroke: var(--primary-color);
}

.stat-box h3 {
    font-size: 2rem;
    /* Smaller stat number */
    font-weight: 700;
    color: #fff;
    margin: 0 0 5px 0;
    line-height: 1.1;
    background: linear-gradient(to bottom, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-box p {
    font-size: 0.75rem;
    /* Tiny label */
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* =================================== */
/* == Tertiary Hero Section == */
/* =================================== */

.tertiary-hero {
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    background: transparent;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.tertiary-hero::before {
    display: none;
}

.tertiary-hero .container {
    position: relative;
    z-index: 2;
}

.tertiary-hero h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Skeleton Loading Animation */
.skeleton-card {
    opacity: 1 !important;
    /* Override fade-in animation for instant loading state */
    animation: none !important;
    pointer-events: none;
    border-color: #333;
}

.skeleton {
    background: #2a2a2a;
    background: linear-gradient(110deg, #2a2a2a 8%, #323232 18%, #2a2a2a 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
    to {
        background-position-x: -200%;
    }
}

.skeleton-image {
    width: 100%;
    height: 180px;
    display: block;
}

.skeleton-title {
    height: 20px;
    width: 70%;
    margin-bottom: 15px;
    border-radius: 4px;
}

.skeleton-price {
    height: 20px;
    width: 30%;
    border-radius: 4px;
}

/* Checkout Page Styles */
.checkout-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.checkout-form-container,
.order-summary {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.checkout-form-container h1,
.order-summary h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.checkout-form-container .form-group {
    margin-bottom: 1.5rem;
}

.checkout-form-container label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.checkout-form-container input {
    width: 100%;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    font-size: 1rem;
    box-sizing: border-box;
}

.checkout-form-container input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.whatsapp-checkout-btn {
    /* 1. Reset all previous styles */
    all: unset;

    /* 2. Basic Layout */
    display: flex !important;
    justify-content: center !important;
    /* හරහට හරියටම මැදට */
    align-items: center !important;
    /* උඩ යට හරියටම මැදට */
    width: 100% !important;
    box-sizing: border-box !important;
    height: 55px !important;
    margin-top: 20px !important;
    cursor: pointer !important;

    /* 3. Colors & Branding */
    background-color: #25D366 !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    /* Sharp corners */

    /* 4. Typography - No Caps & Centered */
    font-family: var(--font-family), sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-transform: none !important;
    white-space: nowrap !important;
    /* එක පේළියට තබා ගැනීමට */

    /* 5. Clean Padding */
    padding: 0 !important;
    /* කිසිම padding එකක් අවශ්‍ය නැත flex center කරන නිසා */

    transition: background 0.3s ease !important;
}

.whatsapp-checkout-btn:hover {
    background-color: #1eb954 !important;
}

.summary-card {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.summary-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
}

.summary-details h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.summary-price {
    margin: 0;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .order-summary {
        order: -1;
        /* Show summary first on mobile */
    }
}

/* --- Final Mobile Centering Fix --- */
@media (max-width: 768px) {

    /* 1. Body එකේ horizontal scroll එක නැති කරන්න */
    body,
    html {
        overflow-x: hidden;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* 2. මුළු Layout එකම මැදට ගන්න */
    .checkout-layout {
        display: flex;
        flex-direction: column;
        align-items: center;
        /* මැදට align කරයි */
        justify-content: center;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 10px !important;
        box-sizing: border-box;
    }

    /* 3. Containers වල width එක හරියටම set කරන්න */
    .checkout-form-container,
    .order-summary {
        width: 95% !important;
        /* Screen එකේ දෙපැත්තෙන් පොඩි ඉඩක් තබයි */
        max-width: 100% !important;
        margin: 10px 0 !important;
        padding: 20px !important;
        /* Padding අඩු කරන්න */
        box-sizing: border-box !important;
        /* Padding නිසා width එක වැඩි වීම නවත්වයි */
        float: none !important;
    }

    /* 4. Input fields screen එකට වඩා පළල වීම නවත්වන්න */
    input,
    textarea,
    .summary-card {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 5. Header එක හරියටම මැදට ගන්න */
    .header-container {
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding: 10px 15px;
        box-sizing: border-box;
    }
}

/* =================================== */
/* == Breadcrumbs Styles == */
/* =================================== */

.breadcrumb-nav {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breadcrumb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
}
