:root {
    --primary-blue: #1a5f7a;
    --secondary-teal: #159895;
    --accent-green: #57cc99;
    --light-bg: #f8f9fa;
    --dark-text: #2d3748;
    --light-text: #718096;
    --white: #ffffff;
    --gradient-primary: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-teal) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-teal) 0%, var(--accent-green) 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 15px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    overflow-x: hidden;
}

/* Link Styling - Remove underlines and improve accessibility */
a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.footer-link):not(.social-icon) {
    color: var(--secondary-teal);
    font-weight: 500;
    border-bottom: 1px solid transparent;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.footer-link):not(.social-icon):hover {
    color: var(--primary-blue);
    border-bottom: 1px solid var(--primary-blue);
}

/* Specific link types that should never have underlines */
.btn, .nav-link, .dropdown-item, .footer-link, .social-icon,
.card a:not(.btn), .system-card a, .feature-card a {
    text-decoration: none !important;
    border-bottom: none !important;
}

.nav-link, .dropdown-item, .footer-link {
    color: inherit;
}

.nav-link:hover, .dropdown-item:hover, .footer-link:hover {
    color: var(--accent-green);
}

/* Focus styles for accessibility */
a:focus-visible {
    outline: 2px solid var(--accent-green);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 4px;
}

.skip-link:focus {
    top: 0;
}

/* Navigation */
.navbar {
    background: rgba(26, 95, 122, 0.95) !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    padding: 1rem 0;
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-green) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-green);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 6rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="rgba(255,255,255,0.05)"><circle cx="50" cy="50" r="1"/></svg>') repeat;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-100px) translateX(-100px); }
}

.hero-image {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.5s ease;
}

.hero-image:hover {
    transform: translateY(-10px) scale(1.02);
}

/* Buttons */
.btn-brand {
    background: var(--gradient-secondary);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(21, 152, 149, 0.3);
    text-decoration: none;
    display: inline-block;
}

.btn-brand:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(21, 152, 149, 0.4);
    color: white;
}

.btn-outline-brand {
    border: 2px solid var(--secondary-teal);
    color: var(--secondary-teal);
    background: transparent;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-outline-brand:hover {
    background: var(--secondary-teal);
    color: white;
    transform: translateY(-3px);
}

.btn-light-custom {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-blue);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-decoration: none;
    display: inline-block;
}

.btn-light-custom:hover {
    background: white;
    color: var(--primary-blue);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

/* Cards - Ensuring Consistent Sizing */
.system-card, .feature-card {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.system-card {
    min-height: 480px;
}

.feature-card {
    min-height: 280px;
}

.system-card:hover, .feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.system-card .card-body, .feature-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.system-card .card-text, .feature-card .card-text {
    flex: 1;
}

.system-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-size: 2.5rem;
}

.system-features {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.system-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.system-features li:last-child {
    border-bottom: none;
}

/* Card headers and titles */
.card-title {
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: var(--light-text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

/* Sections */
section {
    padding: 5rem 0;
    scroll-margin-top: 80px;
}

.bg-light-custom {
    background-color: var(--light-bg) !important;
}

/* About Section */
.about-stat h4 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-image {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.5s ease;
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.about-image:hover {
    transform: scale(1.02);
}

/* Contact Section */
.contact-info {
    padding: 2rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    background: white;
    box-shadow: var(--shadow);
    height: 100%;
    text-decoration: none;
}

.contact-info:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.contact-info a {
    color: var(--light-text);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.contact-info a:hover {
    color: var(--secondary-teal);
    border-bottom: 1px solid var(--secondary-teal);
}

.form-control {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--secondary-teal);
    box-shadow: 0 0 0 3px rgba(21, 152, 149, 0.1);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #0c3c4c 0%, #0a2d38 100%);
}

.footer-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 0.5rem;
    border: none;
}

.footer-link:hover {
    color: var(--accent-green);
}

.footer a:not(.footer-link):not(.social-icon) {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.footer a:not(.footer-link):not(.social-icon):hover {
    color: var(--accent-green);
    border-bottom: 1px solid var(--accent-green);
}

.social-icon {
    font-size: 1.2rem;
    margin-right: 1rem;
    transition: all 0.3s ease;
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    text-align: center;
    line-height: 40px;
}

.social-icon:hover {
    color: var(--accent-green) !important;
    transform: translateY(-3px);
    background: rgba(255,255,255,0.2);
}

/* Animations */
.animate-fade-in-up, .animate-fade-in-left, .animate-fade-in-right {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.animate-fade-in-left {
    transform: translateX(-30px);
}

.animate-fade-in-right {
    transform: translateX(30px);
}

.animate-fade-in-up.show, 
.animate-fade-in-left.show, 
.animate-fade-in-right.show {
    opacity: 1;
    transform: translate(0);
}

.animate-fade-in-up-delay { transition-delay: 0.2s; }
.animate-fade-in-up-delay-2 { transition-delay: 0.4s; }
.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }

/* Map styling */
.maps-container iframe {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    width: 100%;
    height: 300px;
    border: none;
}

.maps-container .card {
    height: 100%;
}

.maps-container .card-header {
    background: var(--gradient-primary);
    border: none;
    font-weight: 600;
    padding: 1rem;
}

/* Custom styles for dropdown positioning */
.navbar-nav .dropdown-menu {
    left: auto;
    right: 0;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.navbar-nav .nav-item.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: var(--light-bg);
    color: var(--primary-blue);
}

@media (max-width: 991.98px) {
    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        box-shadow: none;
        background: transparent;
    }
    
    .dropdown-item {
        color: rgba(255,255,255,0.8);
    }
    
    .dropdown-item:hover {
        color: var(--accent-green);
        background: transparent;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 0 2rem;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .system-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .about-stat h4 {
        font-size: 2rem;
    }
    
    .contact-info {
        padding: 1.5rem 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .navbar-nav {
        background: rgba(26, 95, 122, 0.95);
        padding: 1rem;
        border-radius: 10px;
        margin-top: 1rem;
    }
    
    .system-card, .feature-card {
        min-height: auto;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-image {
        max-height: 250px;
    }
    
    section {
        padding: 3rem 0;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Print styles for better SEO */
@media print {
    .navbar, .footer, .btn {
        display: none;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
        padding: 2rem 0;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Navbar Text Visibility Fixes */
.navbar-brand,
.navbar-brand span,
.navbar-brand:hover,
.navbar-brand:focus {
    color: #ffffff !important;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
    color: #57cc99 !important;
}

.navbar-nav .dropdown-toggle {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-nav .dropdown-toggle:hover,
.navbar-nav .dropdown-toggle:focus {
    color: #57cc99 !important;
}

/* Ensure dropdown items have proper contrast */
.dropdown-menu {
    background: white;
}

.dropdown-item {
    color: #2d3748 !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: #f8f9fa;
    color: #1a5f7a !important;
}

/* Mobile menu specific fixes */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(26, 95, 122, 0.98);
        padding: 1rem;
        border-radius: 10px;
        margin-top: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
}

/* Navbar toggler color for better visibility */
.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}