/* Soleco AS - Complete Stylesheet with Accessibility Improvements */

/* CSS Custom Properties - Enhanced for better accessibility */
:root {
    --navy: #1E3A8A; /* Improved contrast */
    --teal: #0D9488;
    --teal-dark: #0F766E;
    --slate: #374151; /* Improved contrast from #5B6770 */
    --cloud: #F8FAFC; /* Slightly improved contrast */
    --ink: #1F2937; /* Improved contrast from #3A444C */
    --white: #FFFFFF;
    --amber: #D97706; /* Improved contrast from #F4A259 */
    --shadow: rgba(43, 76, 126, 0.15);
    --transition: all 0.3s ease;
    --error: #DC2626; /* Improved contrast */
    --success: #059669; /* Improved contrast */
    --warning: #D97706; /* Improved contrast */
    --focus-ring: #3B82F6; /* New focus ring color */
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--cloud);
    transition: var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #20576E;
    color: var(--white);
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    font-weight: 600;
    transition: var(--transition);
}

.skip-link:focus {
    top: 6px;
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Container */
.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: #20576E;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 100;
    transition: var(--transition);
    color: var(--cloud);
}

.header.scrolled {
    box-shadow: 0 8px 24px rgba(24, 40, 66, 0.35);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
    max-width: 200px;
    background: var(--white);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.95); /* Improved contrast */
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    position: relative;
}

.nav-links a:hover {
    color: var(--white);
    background: rgba(13, 148, 136, 0.2);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.nav-links a:focus {
    color: var(--white);
    background: transparent;
    border: 2px solid var(--white);
    outline: none;
}

.nav-links a:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.nav-links a:active {
    color: var(--white);
    background: transparent;
    border: 2px solid var(--white);
    transform: scale(0.98);
}

/* CTA Button */
.cta-button {
    background: var(--teal);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: inline-block;
    font-size: 1rem;
    min-height: 44px; /* Minimum touch target size */
    min-width: 44px;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-button:active::before {
    width: 300px;
    height: 300px;
}

.cta-button:hover,
.cta-button:focus {
    background: var(--teal-dark);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(13, 148, 136, 0.3);
    outline: none;
}

.cta-button:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.cta-button:active {
    transform: translateY(-1px) scale(1.02);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
    min-height: 44px;
    min-width: 44px;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.mobile-menu-toggle:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #D1D9E6 0%, #B8C5D6 100%);
    padding: 6rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="%231E40AF" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    animation: float 20s ease-in-out infinite;
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #0A7E8C;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero p {
    font-size: 1.25rem;
    color: var(--slate);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Scroll Indicators */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(13, 148, 136, 0.1);
    z-index: 1000;
}

.scroll-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--teal), var(--teal-dark));
    width: 0%;
    transition: width 0.1s ease;
}

/* Floating Elements */
.floating-shape {
    position: absolute;
    opacity: 0.1;
    pointer-events: none;
    z-index: 1;
}

.floating-shape-1 {
    top: 10%;
    right: 10%;
    width: 60px;
    height: 60px;
    background: var(--teal);
    border-radius: 50%;
    animation: floatShape 15s ease-in-out infinite;
}

.floating-shape-2 {
    bottom: 20%;
    left: 5%;
    width: 40px;
    height: 40px;
    background: var(--amber);
    transform: rotate(45deg);
    animation: floatShape 12s ease-in-out infinite reverse;
}

.floating-shape-3 {
    top: 60%;
    right: 20%;
    width: 30px;
    height: 30px;
    background: #20576E;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation: floatShape 18s ease-in-out infinite;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section-alt-1 {
    background: var(--cloud);
}

.section-alt-2 {
    background: #E2E8F0;
}

.section h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: #0A7E8C;
    margin-bottom: 3rem;
    text-align: center;
    font-weight: 700;
}

.section p {
    font-size: 1.1rem;
    color: var(--slate);
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Cards */
.card {
    background: linear-gradient(135deg, #FFFFFF 0%, #EFF6FF 100%);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid rgba(13, 148, 136, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
    position: relative;
    overflow: hidden;
}

.card.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Fallback for when JS doesn't load */
.no-js .card {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(13, 148, 136, 0.15);
    border-color: var(--teal);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(13, 148, 136, 0.1), transparent);
    transition: left 0.6s;
}

.card:hover::before {
    left: 100%;
}

.card h3 {
    color: #0A7E8C;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.card p {
    color: var(--slate);
    margin: 0;
    line-height: 1.6;
}

/* Service Icons */
.service-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.service-icon svg {
    width: 32px;
    height: 32px;
    color: var(--white);
    stroke-width: 2.5;
}

.card:hover .service-icon {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.3);
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

/* Timeline */
.timeline {
    position: relative;
    margin-top: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--teal);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    width: 45%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
    padding-right: 2rem;
}

.timeline-item:nth-child(even) {
    left: 55%;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--amber);
    border-radius: 50%;
    top: 0.5rem;
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.timeline-item:hover::before {
    transform: scale(1.3);
    box-shadow: 0 0 0 8px rgba(217, 119, 6, 0.25);
    background: var(--teal);
}

.timeline-item:hover {
    transform: translateX(10px);
}

.timeline-item:nth-child(even):hover {
    transform: translateX(-10px);
}

.timeline-item:nth-child(odd)::before {
    right: -8px;
}

.timeline-item:nth-child(even)::before {
    left: -8px;
}

.timeline-year {
    font-weight: 700;
    color: #0A7E8C;
    font-size: 1.1rem;
}

.timeline-content {
    color: var(--slate);
    margin-top: 0.5rem;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #20576E;
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
    margin-top: 5rem;
}

.footer a {
    color: var(--white);
    text-decoration: none;
    margin: 0 1rem;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--teal);
}

.footer p {
    margin-bottom: 1rem;
}

/* Contact Info */
.contact-info {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-item svg {
    width: 20px;
    height: 20px;
    fill: var(--amber);
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--teal);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
    min-height: 44px;
    min-width: 44px;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--teal-dark);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

.scroll-to-top:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

/* Enhanced Focus States for Accessibility */
*:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Smooth Animations with Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .card:hover {
        transform: none;
    }
    
    .cta-button:hover {
        transform: none;
    }
    
    .timeline-item::before {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --navy: #000000;
        --teal: #0066CC;
        --teal-dark: #000000;
        --slate: #000000;
        --cloud: #FFFFFF;
        --ink: #000000;
        --white: #FFFFFF;
        --amber: #000000;
        --focus-ring: #0066CC;
    }
    
    .card {
        border: 2px solid var(--ink);
    }
    
    .cta-button {
        border: 2px solid var(--ink);
    }
}

/* Large Text Support */
@media (prefers-text-size: large) {
    body {
        font-size: 1.2rem;
    }
    
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .section h2 {
        font-size: 3rem;
    }
}

/* Form Enhancements */
.form-group input:invalid {
    border-color: var(--error);
}

.form-group input:valid {
    border-color: var(--success);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--teal);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    .header,
    .mobile-menu-toggle,
    .theme-toggle,
    .cta-button,
    .contact-form,
    .scroll-to-top,
    .floating-shape {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Contact Form */
.contact-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--navy);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
    color: var(--ink);
    min-height: 44px; /* Minimum touch target size */
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.form-group input:focus-visible,
.form-group textarea:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Image Optimization */
img {
    transition: opacity 0.3s ease;
    max-width: 100%;
    height: auto;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: left 0.3s ease;
        z-index: 999;
    }
    
    .nav-links.active {
        left: 0;
        display: flex;
    }
    
    .nav-links li {
        margin: 1rem 0;
    }
    
    .nav-links a {
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--ink);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-menu-toggle.active {
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 1000;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .two-column {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        left: 0 !important;
        text-align: left !important;
        padding-left: 3rem !important;
        padding-right: 0 !important;
    }

    .timeline-item::before {
        left: 12px !important;
        right: auto !important;
    }

    .contact-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-button {
        width: 100%;
        max-width: 300px;
    }
}

/* Tablet Responsive Design */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop Responsive Design */
@media (min-width: 1025px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Dark Mode Support */
.dark-mode .card {
    background: var(--cloud);
    border-color: var(--slate);
}

.dark-mode .form-group input,
.dark-mode .form-group textarea {
    background: var(--white);
    color: var(--ink);
}

.dark-mode .nav-links a {
    color: var(--ink);
}

.dark-mode .nav-links a:hover,
.dark-mode .nav-links a:focus {
    color: var(--teal);
}

.dark-mode .contact-form {
    background: var(--cloud);
}

/* Enhanced Focus for Better Keyboard Navigation */
.cta-button:focus-visible,
.nav-links a:focus-visible,
.mobile-menu-toggle:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Message Notifications */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    max-width: 400px;
    animation: slideIn 0.3s ease;
    font-weight: 500;
}

.message-success {
    background: var(--success);
    color: white;
}

.message-error {
    background: var(--error);
    color: white;
}

.message-info {
    background: var(--teal);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

