/*
 * UI/UX Enhancements for GEODBMS Website
 * This file contains professional UI improvements including:
 * - Sticky header
 * - Mobile menu
 * - Toast notifications
 * - Loading states
 * - Smooth animations
 */

/* Enhanced Typography */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
}

/* Sticky Header Enhancements */
header {
    position: sticky !important;
    top: 0;
    z-index: 1000;
    transition: padding 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    padding: 10px 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

header.scrolled .logo {
    height: 60px !important;
}

.logo {
    transition: height 0.3s ease;
}

/* Enhanced Navigation */
nav ul {
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

nav ul li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

nav ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease;
    z-index: -1;
}

nav ul li a:hover::before {
    left: 0;
}

nav ul li a:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

nav ul li a.active {
    box-shadow: 0 2px 8px rgba(43, 94, 166, 0.4);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    font-size: 1.5em;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    right: 20px;
    top: 15px;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.mobile-menu-toggle:focus {
    outline: 2px solid #D4A574;
    outline-offset: 2px;
}

/* Content Animations */
.content-section {
    animation: fadeIn 0.4s ease-out;
}

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

/* Enhanced Section Headings */
.intro h2::after, .features h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #6B3744;
    margin-top: 3px;
}

.features ul {
    list-style-type: none;
    padding-left: 0;
}

.features ul li {
    padding: 10px 0 10px 30px;
    position: relative;
    transition: transform 0.2s ease;
}

.features ul li:hover {
    transform: translateX(5px);
}

.features ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2B5EA6;
    font-weight: bold;
    font-size: 1.2em;
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: #fff;
    border-left: 4px solid #2B5EA6;
    border-radius: 6px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease-out;
    pointer-events: auto;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.removing {
    animation: toastSlideOut 0.3s ease-out;
}

.toast.toast-success {
    border-left-color: #28a745;
}

.toast.toast-error {
    border-left-color: #dc3545;
}

.toast.toast-warning {
    border-left-color: #ffc107;
}

.toast.toast-info {
    border-left-color: #17a2b8;
}

.toast-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
    font-size: 1em;
}

.toast-message {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

.toast-close {
    background: transparent;
    border: none;
    font-size: 1.3em;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(107, 55, 68, 0.3);
    border-top-color: #6B3744;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

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

.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    backdrop-filter: blur(2px);
}

.loading-overlay .loading-spinner {
    width: 60px;
    height: 60px;
    border-width: 6px;
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

/* Enhanced Service Items */
.service-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.service-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(107, 55, 68, 0.25);
    border-left-width: 8px;
}

.service-item ul li {
    transition: transform 0.2s ease;
}

.service-item ul li:hover {
    transform: translateX(5px);
}

/* Improved Info Boxes */
.info-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Focus States for Accessibility */
*:focus-visible {
    outline: 2px solid #2B5EA6;
    outline-offset: 2px;
}

/* Selection Styles */
::selection {
    background: #D4A574;
    color: #fff;
}

::-moz-selection {
    background: #D4A574;
    color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile menu toggle button (only used if navigation.js hamburger doesn't exist) */
    .mobile-menu-toggle {
        display: block;
    }

    /* Only apply these mobile menu styles if using the ui-enhancements menu system */
    /* These styles are disabled to avoid conflicts with the main hamburger menu in navigation.js */
    /*
    nav ul {
        display: none !important;
        flex-direction: column;
        width: 100%;
        background: rgba(107, 55, 68, 0.98);
        position: absolute;
        top: 100%;
        left: 0;
        padding: 20px 0;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        border-radius: 0 0 8px 8px;
    }

    nav ul.mobile-menu-open,
    nav.active ul {
        display: flex !important;
    }

    nav ul li {
        display: block;
        margin: 8px 20px;
        width: calc(100% - 40px);
    }

    nav ul li a {
        display: block;
        width: 100%;
        text-align: left;
        padding: 12px 16px;
    }

    nav ul li a:hover {
        transform: translateX(5px);
    }
    */

    /* Toast notifications */
    .toast-container {
        top: 70px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .toast {
        padding: 12px 16px;
    }

    .toast-icon {
        font-size: 1.2em;
    }

    .toast-title {
        font-size: 0.95em;
    }

    .toast-message {
        font-size: 0.85em;
    }
}
