/* Modern Components CSS */
/* Updated styling for modern UI components */

/* Product Card Styles */
.product-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 148, 68, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #009444, #00b84d);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

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

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #009444, #00b84d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-card p {
    color: #5a6c7d;
    line-height: 1.6;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Modern Button Styles */
.modern-btn {
    background: linear-gradient(135deg, #009444 0%, #00b84d 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 148, 68, 0.3);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
}

.modern-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.modern-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 148, 68, 0.4);
}

.modern-btn:hover::before {
    left: 100%;
}

.modern-btn:active {
    transform: translateY(-1px);
}

/* Page Header Styles */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.page-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #009444, #00b84d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    position: relative;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #009444, #00b84d);
    border-radius: 2px;
}

/* Modern Container */
.modern-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Responsive Grid */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* 3-column layout for subpages */
.subpage-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
        gap: 2.5rem;
    }
    
    .page-header h1 {
        font-size: 4rem;
    }
}

@media (max-width: 1024px) {
    .subpage-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .subpage-products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === Unified Modern Background === */
/* Gradient on the body */
body.modern-background {
    background: linear-gradient(135deg, #05668d 0%, #028090 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden; /* avoid horizontal scroll */
}

body.modern-background::before {
    content: '';
    position: fixed; /* fixed so it stays behind while scrolling */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
    z-index: -1; /* stays behind all content including navbar */
}

/* === Transparent Sections === */
body.modern-background .landing,
body.modern-background .products {
    background: transparent !important;
    position: relative;
}

/* Remove old overlays */
body.modern-background .landing::before,
body.modern-background .landing::after,
body.modern-background .products::before,
body.modern-background .products::after {
    display: none !important;
}

/* === Navbar Layer Fix === */
/* Ensure navbar always stays on top */
.navbar {
    position: relative;
    z-index: 10;
}



/* Secondary Button Styles */
.secondary-btn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.3) !important;
}

.secondary-btn:hover {
    box-shadow: 0 12px 35px rgba(108, 117, 125, 0.4) !important;
}

/* Product Card Link Styles */
.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card-link:hover .product-card {
    transform: translateY(-8px);
}

/* Product Icon Styles */
.product-icon {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #009444;
}

/* Product Buttons Container */
.product-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: auto;
}

.product-buttons .modern-btn {
    flex: 1;
    min-width: 140px;
    text-align: center;
}

@media (max-width: 768px) {
    .product-buttons {
        flex-direction: column;
    }
    
    .product-buttons .modern-btn {
        margin-left: 0;
        margin-bottom: 0.5rem;
    }
    
    .secondary-btn {
        margin-left: 0 !important;
    }
}

/* Main Page Product Grid - 3 columns, 2 rows */
.main-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 4rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.main-product-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    border-radius: 20px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: block;
}

.main-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #009444, #00b84d);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.main-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(248,249,250,1) 100%);
}

.main-product-card:hover::before {
    transform: scaleX(1);
}

.main-product-card h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #009444, #00b84d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.main-product-card p {
    color: #5a6c7d;
    line-height: 1.6;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.main-product-card .product-icon {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #009444;
}

@media (max-width: 1024px) {
    .main-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
}

@media (max-width: 768px) {
    .main-products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-product-card {
        padding: 1.2rem;
    }
    
    .main-product-card h2 {
        font-size: 1.3rem;
    }
    
    .main-product-card p {
        font-size: 0.85rem;
    }
}

/* Landing Section Enhancements */
.landing .modern-btn {
    margin-top: 2rem;
}

/* Modern text styling for main page */
body.modern-background .landing .text h1 {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.modern-background .landing .text p {
    color: rgba(255,255,255,0.9) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Modern page header styling */
body.modern-background .page-header h1 {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    -webkit-text-fill-color: white !important;
    background: none !important;
}

body.modern-background .page-header h1::after {
    background: linear-gradient(90deg, #ffffff, #f0f0f0);
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
