/* Custom styles for BNWAP website */

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #0e7490;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Star decoration styles inspired by Realta */
.star-decoration {
    position: relative;
}

.star-decoration::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2384cc16'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: -1;
}

/* Hero text animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate {
    animation: fadeInUp 1s ease-out;
}

/* Card hover effects */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

/* Mobile menu styles */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background: white;
    transition: right 0.3s ease;
    z-index: 100;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 99;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Form styles */
.form-input {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-bnwap-blue focus:border-transparent;
}

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

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

/* Responsive image container */
.aspect-ratio-16-9 {
    position: relative;
    padding-bottom: 56.25%;
}

.aspect-ratio-16-9 > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dropdown menu styles */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    display: none;
    min-width: 260px;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 0.75rem 0;
    margin-top: 0;
    border: 1px solid #e5e7eb;
}

/* Add delay for better interaction */
.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

.dropdown-menu:before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

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

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: #f3f4f6;
    color: #0891b2;
    padding-left: 1.5rem;
}

/* Nested dropdown styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: -0.75rem;
    left: 100%;
    margin-left: -1px;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

.dropdown-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-submenu > a::after {
    content: '›';
    margin-left: 1rem;
    color: #9ca3af;
    font-size: 1.2rem;
}

/* Keep dropdowns open when moving between levels */
.dropdown:hover .dropdown-menu,
.dropdown-menu:hover,
.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

/* Mobile dropdown styles */
@media (max-width: 1023px) {
    .dropdown-menu,
    .dropdown-submenu > .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        padding-left: 1rem;
        margin: 0;
    }
    
    .dropdown.active .dropdown-menu,
    .dropdown-submenu.active > .dropdown-menu {
        display: block;
    }
    
    .dropdown > a::after,
    .dropdown-submenu > a::after {
        content: '+';
        float: right;
        transition: transform 0.3s;
    }
    
    .dropdown.active > a::after,
    .dropdown-submenu.active > a::after {
        transform: rotate(45deg);
    }
}