/**
 * GTK Landing Page - Custom CSS
 * Custom styles that complement Tailwind CSS
 */

/* Custom animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Custom shadows */
.shadow-custom {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Frosted glass navbar effect */
#main-header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: rgba(0, 0, 0, 0.5); /* Increased opacity from 0.2 to 0.5 for darker effect */
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease-in-out;
}

/* Custom class for light background when scrolled */
.bg-lightBg-custom {
    background-color: rgba(245, 244, 241, 0.95) !important; /* Semi-transparent light background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Ensure text is readable on frosted glass */
#main-header a {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); /* Enhanced text shadow for better readability */
    font-weight: 600;
}

/* Menu overlay for mobile navigation - MOBILE ONLY */
@media (max-width: 1280px) {
    #menu-overlay {
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        background-color: rgba(0, 0, 0, 0.6); /* Added darker background color */
        transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
        z-index: 40; /* Ensure it's below the hamburger button but above other content */
    }
}

/* Hide menu overlay on desktop */
@media (min-width: 1281px) {
    #menu-overlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

/* Add a subtle glow to the logo */
#header-logo {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

/* Custom transitions */
.transition-custom {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Custom focus styles for better accessibility */
.focus-custom:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

/* Responsive font sizes */
@media (max-width: 640px) {
    .text-responsive {
        font-size: calc(1rem + 1vw);
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
}

/* Feature card animations */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card.card-in-view {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-card .bg-cover {
    opacity: 1 !important; /* Ensure background images are always visible */
}

/* Desktop navigation styles - ensure proper display on large screens */
@media (min-width: 1281px) {
    #main-nav {
        position: static !important;
        left: auto !important;
        width: auto !important;
        height: auto !important;
        background-color: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        overflow: visible !important;
        z-index: auto !important;
    }

    #main-nav ul {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #main-nav li {
        width: auto !important;
        margin: 0 !important;
    }

    #main-nav a {
        color: white !important;
        background-color: transparent !important;
        padding: 0.5rem 1rem !important;
        border-radius: 0 !important;
        transform: none !important;
        width: auto !important;
        display: inline-flex !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
        font-size: 0.875rem !important;
        font-weight: 600 !important;
    }

    #main-nav a:hover {
        color: #F59E0B !important; /* accent color */
        background-color: transparent !important;
        transform: none !important;
    }

    #mobile-menu-toggle {
        display: none !important;
    }

    #close-menu {
        display: none !important;
    }
}

/* Navigation styles for collapsed state (past hero section) - MOBILE ONLY */
@media (max-width: 1280px) {
    .nav-collapsed #main-nav {
        background-color: white !important;
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.15);
        border-right: 1px solid rgba(0, 0, 0, 0.05);
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        z-index: 50;
        padding: 2rem;
        padding-top: 3rem;
        padding-bottom: 5rem;
        overflow-y: auto;
        transition: left 0.3s ease-in-out;
    }

    .nav-collapsed #mobile-menu-toggle {
        display: flex !important; /* Always show hamburger when collapsed */
        position: relative;
        z-index: 60; /* Ensure it's above the menu and overlay */
    }

    .nav-collapsed #main-nav a {
        color: #11557B !important; /* primary color */
        position: relative;
        display: block;
        width: 100%;
        border-radius: 8px;
        transition: all 0.3s ease;
        text-shadow: none; /* Remove text shadow in mobile menu */
        padding: 0.75rem;
        font-size: 1.125rem;
        font-weight: 600;
    }

    .nav-collapsed #main-nav a:hover {
        background-color: rgba(17, 85, 123, 0.05);
        transform: translateX(5px);
    }

    .nav-collapsed #main-nav a:active {
        background-color: rgba(17, 85, 123, 0.1);
    }

    .nav-collapsed #main-nav ul {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* Mobile navigation styles */
@media (max-width: 1280px) {
    /* Mobile menu gets a solid white background for readability */
    #main-nav {
        background-color: white !important;
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.15);
        border-right: 1px solid rgba(0, 0, 0, 0.05);
    }

    /* Navigation list alignment */
    #main-nav ul {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    #main-nav li {
        width: 100%;
        margin: 0;
    }

    /* Navigation links */
    #main-nav a {
        color: #11557B !important; /* primary color */
        position: relative;
        display: flex;
        align-items: center;
        width: 100%;
        border-radius: 8px;
        transition: all 0.3s ease;
        text-shadow: none; /* Remove text shadow in mobile menu */
        padding: 0.75rem;
        margin: 0.25rem 0;
    }

    #main-nav a div {
        display: flex;
        align-items: center;
        width: 100%;
    }

    #main-nav a:hover {
        background-color: rgba(17, 85, 123, 0.05);
        transform: translateX(5px);
    }

    #main-nav a:active {
        background-color: rgba(17, 85, 123, 0.1);
    }

    /* Icon styling in mobile nav */
    #main-nav a i {
        font-size: 1.1rem;
        width: 24px;
        text-align: center;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }

    /* Hide all submenu items in mobile navigation */
    #main-nav .relative ul,
    #main-nav li ul,
    #main-nav .group ul,
    #main-nav ul ul,
    #main-nav li.relative ul,
    #main-nav li.group ul {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Ensure no submenu items are visible */
    #main-nav ul li ul li {
        display: none !important;
    }

    /* Remove any arrows or chevrons in mobile navigation */
    #main-nav a i.fa-chevron-down,
    #main-nav a i.fa-chevron-right,
    #main-nav a .fa-chevron-down,
    #main-nav a .fa-chevron-right {
        display: none !important;
    }

    /* Remove any pseudo-element arrows */
    #main-nav a::after,
    #main-nav a::before {
        display: none !important;
        content: none !important;
    }

    #main-nav .relative ul li {
        margin: 0.25rem 0;
    }

    #main-nav .relative ul a {
        padding: 0.5rem;
        font-size: 0.9rem;
        color: #11557B !important;
    }

    /* Mobile menu toggle button */
    #mobile-menu-toggle {
        position: relative;
        z-index: 60; /* Ensure it's above the menu and overlay */
        cursor: pointer;
    }

    #mobile-menu-toggle span {
        background-color: white !important;
        height: 2px;
        border-radius: 2px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }

    /* Close button alignment */
    #close-menu {
        position: absolute;
        top: 1rem;
        right: 1rem;
        z-index: 61;
    }
}

/* Navigation submenu styling */
@media (min-width: 1281px) {
    /* Desktop submenu styling */
    #main-nav .group ul {
        background: white;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    #main-nav .group ul li a {
        display: block !important;
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        color: #374151 !important; /* gray-700 */
        font-size: 0.875rem !important;
        font-weight: 500 !important;
        border-bottom: 1px solid #f3f4f6 !important; /* gray-100 */
        transition: all 0.2s ease !important;
        text-shadow: none !important;
        transform: none !important;
    }

    #main-nav .group ul li:last-child a {
        border-bottom: none !important;
    }

    #main-nav .group ul li a:hover {
        background-color: #fff7ed !important; /* orange-50 */
        color: #ea580c !important; /* orange-600 */
        transform: none !important;
    }
}

/* Mobile submenu styling */
@media (max-width: 1280px) {
    #main-nav .group ul li a {
        color: #11557B !important;
        padding: 0.5rem 0.75rem !important;
        margin: 0.25rem 0 !important;
        border-radius: 6px !important;
    }

    #main-nav .group ul li a:hover {
        background-color: #fff7ed !important; /* orange-50 */
        color: #ea580c !important; /* orange-600 */
    }
}

/* Utility classes */
.hidden-section {
    display: none !important;
}

/* Calculator results responsive styles */
.calculator-results p {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
}

/* Stack the values vertically on small screens */
.calculator-results #inefficiency-loss,
.calculator-results #fraud-loss,
.calculator-results #total-loss {
    display: inline-block;
    max-width: 100%;
}

@media (max-width: 640px) {
    .calculator-results .bg-lightBg,
    .calculator-results .bg-highlight {
        padding: 1.25rem 1rem;
    }

    .calculator-results h4 {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 480px) {
    .calculator-results p {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }

    .calculator-results #total-loss {
        font-size: 1.5rem !important;
    }

    .calculator-results .bg-lightBg,
    .calculator-results .bg-highlight {
        padding: 1rem 0.75rem;
    }
}

@media (max-width: 380px) {
    .calculator-results p {
        font-size: 1.125rem !important;
    }

    .calculator-results #total-loss {
        font-size: 1.25rem !important;
    }
}
