/* Variables CSS */
:root {
    --primary-color: #1e40af;
    --secondary-color: #3b82f6;
    --accent-color: #00C3FF;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --background-light: #f8fafc;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, #00C3FF 0%, #0099CC 100%);
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
.header {
    background: var(--gradient);
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
    padding: 5px;
}

.mobile-menu span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 3px 0;
    transition: var(--transition);
    border-radius: 2px;
}

.mobile-menu.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Hero Section */
.hero {
    flex: 1;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--white);
    padding-top: 100px;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.5s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-content h2 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 400;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.7s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-content .subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.9s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--white);
    color: var(--primary-color);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow);
    opacity: 0;
    animation: fadeInUp 1s ease forwards 1.1s;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    color: var(--primary-color);
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-dark);
    position: relative;
}

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

/* About Section */
.about {
    background: var(--background-light);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: start;
}

.about-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    position: sticky;
    top: 120px;
}

.about-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.about-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.about-content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.about-content p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    text-align: justify;
}

.services-list {
    list-style: none;
    margin-top: 1.5rem;
}

.services-list li {
    padding: 0.5rem 0;
    color: var(--text-light);
    position: relative;
    padding-left: 1.5rem;
}

.services-list li::before {
    content: '✓';
    color: var(--secondary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 1.1em;
}

/* Judicial Districts */
.districts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.district-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.district-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.district-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.district-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.district-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.district-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.district-link:hover {
    gap: 1rem;
    color: var(--primary-color);
}

/* Services Section */
.services {
    background: var(--background-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    border: 1px solid transparent;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary-color);
}

.service-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.service-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.contact-info h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
    transition: var(--transition);
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-item:hover {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    margin: 0 -0.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.contact-icon {
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-item a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.contact-item a:hover {
    color: var(--primary-color);
}

.links-section {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.links-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.links-section a {
    display: block;
    color: var(--text-light);
    text-decoration: none;
    padding: 0.75rem 0;
    transition: var(--transition);
    border-bottom: 1px solid #f3f4f6;
    border-radius: 4px;
}

.links-section a:hover {
    color: var(--primary-color);
    padding-left: 10px;
    background: rgba(59, 130, 246, 0.05);
}

.links-section a:last-child {
    border-bottom: none;
}

/* Fixed Elements */
.fixed-contact {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.fixed-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.whatsapp-btn {
    background: #25d366;
}

.whatsapp-btn:hover {
    background: #128c7e;
}

.phone-btn {
    background: var(--primary-color);
}

.phone-btn:hover {
    background: var(--secondary-color);
}

.fixed-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-hover);
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
}

.footer p {
    margin: 0;
    opacity: 0.8;
}

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

/* Utilities */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
        border-radius: 0 0 15px 15px;
        gap: 0;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #f3f4f6;
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 1rem;
    }

    .mobile-menu {
        display: flex;
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-card {
        position: static;
        order: 2;
    }

    .about-content {
        order: 1;
    }

    .districts-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }

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

    .section-title {
        font-size: 2rem;
    }

    .section {
        padding: 4rem 0;
    }

    .fixed-contact {
        right: 15px;
        bottom: 15px;
    }

    .fixed-btn {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .section {
        padding: 3rem 0;
    }

    .district-card,
    .service-card,
    .contact-info,
    .links-section {
        padding: 1.5rem;
    }

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

    .hero-content h2 {
        font-size: 1.5rem;
    }

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

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .hero-cta {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-content h1,
    .hero-content h2,
    .hero-content .subtitle,
    .hero-cta {
        opacity: 1;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
    }
    
    .navbar {
        border-bottom: 2px solid var(--primary-color);
    }
}

/* Print styles */
@media print {
    .navbar,
    .fixed-contact,
    .hero-cta {
        display: none;
    }
    
    .section {
        padding: 2rem 0;
        break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}