/* ==========================================================================
   CLEAN & FINAL main.css - OPTIMIZED FOR FAST LOADING
   Organized by Sections | Fixed Syntax Errors | Enhanced Responsiveness
   ========================================================================== */

/* ==========================================================================
   1. CSS Custom Properties (Variables)
   ========================================================================== */
:root {
    --p: #19fd0d;
    /* Primary Blue */
    --s: #6610f2;
    /* Secondary Purple */
    --g: #28a745;
    /* Success Green */
    --d: #212529;
    /* Dark Gray */
    --l: #f8f9fa;
    /* Light Gray */
    --gp: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    /* Main Gradient */
    --br: 20px;
    /* Border Radius */
    --sh: 0 10px 30px rgba(0, 0, 0, 0.1);
    /* Shadow */
    --tr: all 0.3s ease;
    /* Transition */
}

/* ==========================================================================
   2. Base Reset and Typography
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* ==========================================================================
   3. Navigation Styles
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    transition: var(--tr);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    background: rgba(255, 255, 255, 0.98);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.8rem;
    text-decoration: none;
}

.navbar-logo {
    width: 200px;
    height: 100px;
    object-fit: contain;
    transition: var(--tr);
}

.navbar-logo:hover {
    transform: scale(1.1);
}

.navbar-text {
    font-size: 1.2rem;
    line-height: 1.1;
}

.navbar-text strong {
    background: var(--gp);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    color: #555 !important;
    transition: var(--tr);
    margin: 0 10px;
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    color: var(--p) !important;
    transform: translateY(-2px);
}

/* ==========================================================================
   4. Hero Slider Styles
   ========================================================================== */
.hero {
    position: relative;
    color: #fff;
    min-height: 100vh;
    margin-top: 80px;
    /* Avoid navbar overlap */
    overflow: hidden;
}

.carousel {
    position: relative;
    z-index: 1;
}

.carousel-item {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.carousel-fade .carousel-item {
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-fade .carousel-item.active {
    opacity: 1;
}

.hero-slide-bg {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensure proper scaling */
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 4rem;
    z-index: 2;
    pointer-events: none;
    /* Allow child elements to handle clicks */
}

.hero-overlay .overlay-content {
    position: relative;
    z-index: 3;
    pointer-events: auto;
    /* Enable clicks on content */
    max-width: 400px;
    text-align: center;
    color: white;
}

.product-badge {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.overlay-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.overlay-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.overlay-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.overlay-cta {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    width: auto;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: auto !important;
    /* Ensure clickable */
    z-index: 10;
    /* Above all layers */
    color: #fff;
    text-decoration: none;
}

.btn-success {
    background: var(--g);
    color: #fff;
    border: none;
}

.btn-success:hover {
    background: #218838;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.2);
}

.hero-content-wrapper {
    position: relative;
    z-index: 3;
    background: rgba(0, 0, 0, 0.4);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* Specific Slide Images */
.soilmaster-hero {
    background-image: url('assets/images/hero/soilmaster.jpg');
}

.microsense-hero {
    background-image: url('assets/images/hero/microsenseai.png');
}

.mlm-hero {
    background-image: url('assets/images/hero/mlmnetwork.png');
}

/* ==========================================================================
   5. Section Styles
   ========================================================================== */
.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    background: var(--gp);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gp);
    border-radius: 2px;
}

/* ==========================================================================
   6. Card Styles
   ========================================================================== */
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--br);
    padding: 2.5rem;
    box-shadow: var(--sh);
    transition: var(--tr);
    margin-bottom: 2rem;
}

.glass-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.product-card {
    background: #fff;
    border-radius: var(--br);
    overflow: hidden;
    box-shadow: var(--sh);
    transition: var(--tr);
    border: none;
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: inherit;
}

.product-header {
    background: var(--gp);
    color: #fff;
    padding: 2rem;
    text-align: center;
}

/* ==========================================================================
   7. Button Styles
   ========================================================================== */
.btn {
    border-radius: 50px;
    font-weight: 600;
    padding: 0.75rem 2rem;
    transition: var(--tr);
    text-decoration: none;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: var(--g);
    color: #fff;
}

.btn-success:hover {
    background: #218838;
    color: #fff;
}

/* ==========================================================================
   8. Animations
   ========================================================================== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   9. Responsive Design
   ========================================================================== */
@media (max-width: 1200px) {
    .navbar-logo {
        width: 150px;
        height: 75px;
    }

    .hero-overlay {
        padding: 3rem;
    }

    .product-overlay {
        width: 40%;
    }
}

@media (max-width: 992px) {
    .product-overlay {
        display: none;
    }

    .hero-overlay {
        position: static !important;
        padding: 2rem !important;
        background: none !important;
    }

    .overlay-content {
        max-width: 100% !important;
    }

    .overlay-title {
        font-size: 2rem !important;
    }

    .navbar-logo {
        width: 150px;
        height: 75px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content .lead {
        font-size: 1.2rem;
    }

    .hero {
        min-height: auto;
    }

    .carousel-item {
        height: auto;
        min-height: 400px;
    }

    .hero-slide-bg {
        height: auto;
    }

    .hero-bg-image {
        height: auto;
    }
}

@media (max-width: 768px) {
    .hero-overlay {
        padding: 1rem !important;
    }

    .overlay-stats {
        flex-direction: column;
        align-items: center;
    }

    .overlay-title {
        font-size: 1.8rem !important;
    }

    .hero-content-wrapper {
        background: rgba(0, 0, 0, 0.7) !important;
    }

    .navbar-logo {
        width: 100px;
        height: 50px;
    }

    .navbar-text {
        font-size: 0.9rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content .lead {
        font-size: 1rem;
    }

    .hero-slide-bg {
        background-attachment: scroll;
    }

    .product-header {
        padding: 1rem;
    }

    .overlay-cta {
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
        width: 100%;
    }
}

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

    .carousel-indicators {
        display: none;
    }

    .navbar-brand {
        font-size: 1.5rem;
    }

    .nav-link {
        margin: 0 5px;
        font-size: 0.9rem;
    }

    .hero-overlay {
        padding: 0.5rem !important;
    }

    .overlay-title {
        font-size: 1.5rem !important;
    }

    .overlay-subtitle {
        font-size: 0.9rem;
    }

    .overlay-stats {
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .hero-content .lead {
        font-size: 0.9rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-lg {
        width: 100%;
        max-width: 250px;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 320px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-logo {
        width: 80px;
        height: 40px;
    }

    .hero-content h1 {
        font-size: 1.2rem;
    }

    .overlay-title {
        font-size: 1.2rem !important;
    }

    .overlay-cta {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
}

/* ==========================================================================
   10. Carousel Controls
   ========================================================================== */
.carousel-indicators [data-bs-target] {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.6);
    margin: 0 5px;
    transition: var(--tr);
}

.carousel-indicators .active {
    background: #fff;
    transform: scale(1.3);
    border-color: #fff;
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
    transition: var(--tr);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-size: 25px;
    filter: invert(1);
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
}

@media (max-width: 992px) {

    .carousel-control-prev,
    .carousel-control-next {
        display: none;
    }
}

/* ==========================================================================
   11. Card Styles
   ========================================================================== */
.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--br);
    transition: var(--tr);
    padding: 1.5rem;
}

.feature-card {
    text-align: center;
    cursor: default;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
}

.product-card {
    background: #fff;
    border-radius: var(--br);
    overflow: hidden;
    box-shadow: var(--sh);
    transition: var(--tr);
    border: none;
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.product-header {
    background: var(--gp);
    color: #fff;
    padding: 2rem;
    text-align: center;
}

.product-header h3 {
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* ==========================================================================
   12. Button Styles
   ========================================================================== */
.btn {
    border-radius: 50px;
    font-weight: 600;
    padding: 0.75rem 2rem;
    transition: var(--tr);
    text-decoration: none;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: var(--g);
    color: #fff;
}

.btn-success:hover {
    background: #218838;
    color: #fff;
}

.btn-purple {
    background: linear-gradient(135deg, #6f42c1 0%, #6610f2 100%);
    color: #fff;
}

.btn-purple:hover {
    background: linear-gradient(135deg, #5a32a3, #5a32a3);
    color: #fff;
}

/* ==========================================================================
   13. Forms & Validation
   ========================================================================== */
.form-floating {
    margin-bottom: 1rem;
}

.form-floating>.form-control:focus~label,
.form-floating>.form-control:not(:placeholder-shown)~label {
    color: var(--p);
}

.form-control.is-valid {
    border-color: var(--g);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.contact-hero {
    background: var(--gp);
    color: #fff;
    padding: 100px 0;
}

.map-container {
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--sh);
}

.alert-success-custom {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: none;
    border-radius: 10px;
    color: #155724;
}

/* ==========================================================================
   14. Utility Classes
   ========================================================================== */
.gradient-text {
    background: linear-gradient(45deg, #fff, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.animate-slide {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.animate-slide.visible {
    opacity: 1;
    transform: translateY(0);
}

.badge {
    font-size: 0.8rem;
    border-radius: 50px;
    padding: 0.5rem 1rem;
}

/* ==========================================================================
   15. Device Mockups & Overlays
   ========================================================================== */
.device-mockup {
    position: relative;
    max-width: 300px;
    margin: 0 auto;
}

.device-mockup::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 450px;
    background: #000;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.screen {
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    height: 450px;
    margin-top: 10px;
}

.app-interface {
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.status-bar {
    background: var(--gp);
    color: white;
    padding: 0.5rem;
    font-weight: 600;
    text-align: center;
}

.analysis-results {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.value {
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.value.high {
    background: #d4edda;
    color: #155724;
}

.value.medium {
    background: #fff3cd;
    color: #856404;
}

.value.low {
    background: #f8d7da;
    color: #721c24;
}

.analysis-overlay,
.detection-overlay,
.network-overlay {
    display: none;
}

/* ==========================================================================
   16. Responsive Design
   ========================================================================== */
@media (max-width: 1200px) {
    .navbar-logo {
        width: 150px;
        height: 75px;
    }

    .hero-overlay {
        padding: 3rem;
    }

    .product-overlay {
        width: 40%;
    }
}

@media (max-width: 992px) {
    .product-overlay {
        display: none;
    }

    .hero-overlay {
        position: static !important;
        padding: 2rem !important;
        background: none !important;
    }

    .overlay-content {
        max-width: 100% !important;
    }

    .overlay-title {
        font-size: 2rem !important;
    }

    .navbar-logo {
        width: 150px;
        height: 75px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content .lead {
        font-size: 1.2rem;
    }

    .hero {
        min-height: auto;
    }

    .carousel-item {
        height: auto;
        min-height: 400px;
    }

    .hero-slide-bg {
        height: auto;
    }

    .hero-bg-image {
        height: auto;
    }
}

@media (max-width: 768px) {
    .hero-overlay {
        padding: 1rem !important;
    }

    .overlay-stats {
        flex-direction: column;
        align-items: center;
    }

    .overlay-title {
        font-size: 1.8rem !important;
    }

    .hero-content-wrapper {
        background: rgba(0, 0, 0, 0.7) !important;
    }

    .navbar-logo {
        width: 100px;
        height: 50px;
    }

    .navbar-text {
        font-size: 0.9rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content .lead {
        font-size: 1rem;
    }

    .hero-slide-bg {
        background-attachment: scroll;
    }

    .product-header {
        padding: 1rem;
    }

    .overlay-cta {
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
        width: 100%;
    }
}

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

    .carousel-indicators {
        display: none;
    }

    .navbar-brand {
        font-size: 1.5rem;
    }

    .nav-link {
        margin: 0 5px;
        font-size: 0.9rem;
    }

    .hero-overlay {
        padding: 0.5rem !important;
    }

    .overlay-title {
        font-size: 1.5rem !important;
    }

    .overlay-subtitle {
        font-size: 0.9rem;
    }

    .overlay-stats {
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .hero-content .lead {
        font-size: 0.9rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-lg {
        width: 100%;
        max-width: 250px;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 320px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-logo {
        width: 80px;
        height: 40px;
    }

    .hero-content h1 {
        font-size: 1.2rem;
    }

    .overlay-title {
        font-size: 1.2rem !important;
    }

    .overlay-cta {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
}

footer {
    background: var(--d);
    color: #fff;
    padding: 3rem 0 1rem;
    text-align: center
}

footer p {
    margin-bottom: 0.5rem;
    opacity: 0.8
}