/* Design Tokens & Theme Variables */
:root {
    --font-sans: 'Outfit', sans-serif;
    
    /* Navy & Monochromatic Color Palette */
    --navy-darkest: #040814;
    --navy-dark: #0b132b;
    --navy-medium: #1c2541;
    --navy-light: #3a506b;
    --navy-accent: #2e66ff; /* Clean Navy Blue Accent */
    --navy-accent-hover: #4d7dff;
    
    --white: #ffffff;
    --white-muted: #cbd5e1;
    --white-dim: #94a3b8;
    
    /* Glassmorphism Variables */
    --glass-bg: rgba(11, 19, 43, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 16px 40px 0 rgba(4, 8, 20, 0.5);
    --glass-blur: blur(20px);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Core Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--white);
    background-color: var(--navy-darkest);
    overflow-x: hidden;
}

/* Body language handling */
body.lang-en .pt-only {
    display: none !important;
}

body.lang-pt .en-only {
    display: none !important;
}

/* Fullscreen Background & Overlay */
body {
    background-image: url('https://madeiraconnection.com/media/madeira-connection-background.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        rgba(4, 8, 20, 0.8) 0%, 
        rgba(11, 19, 43, 0.5) 50%, 
        rgba(4, 8, 20, 0.85) 100%
    );
    z-index: 1;
}

/* Main Container Layout */
.main-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 860px;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* Header & Logo */
.header {
    width: 100%;
    display: flex;
    justify-content: center;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    height: 64px;
    width: auto;
    max-width: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: var(--transition-smooth);
}

.logo:hover {
    transform: scale(1.03);
}

/* Glassmorphic Central Card */
.glass-card {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 48px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    gap: 36px;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Subtle gloss highlight on the card */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 300%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.03) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    pointer-events: none;
    transition: 0.75s;
}

.glass-card:hover::before {
    left: 150%;
}

/* Language Switcher */
.lang-switcher {
    align-self: flex-end;
    background: rgba(4, 8, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 30px;
    display: flex;
    position: relative;
    gap: 2px;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--white-dim);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    width: 48px;
    padding: 8px 0;
    text-align: center;
    border-radius: 20px;
    cursor: pointer;
    z-index: 2;
    transition: var(--transition-smooth);
}

.lang-btn.active {
    color: var(--white);
}

/* Sliding Pill Indicator */
.toggle-pill {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: 48px; /* Matches button width exactly */
    background: var(--navy-accent);
    border-radius: 20px;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(46, 102, 255, 0.3);
}

/* Adjust sliding pill based on language state */
body.lang-pt .toggle-pill {
    transform: translateX(50px); /* 48px button width + 2px gap */
}

/* Content Transitions */
.card-content {
    position: relative;
    min-height: 180px; /* Keep height stable during transitions */
}

.lang-content {
    display: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.subtitle {
    display: block;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--navy-accent);
    font-weight: 600;
    margin-bottom: 12px;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--white);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--white-muted);
    font-weight: 300;
}

/* Contacts Grid styling */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(46, 102, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(4, 8, 20, 0.25);
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(46, 102, 255, 0.1);
    color: var(--navy-accent);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.contact-card:hover .icon-wrapper {
    background: var(--navy-accent);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(46, 102, 255, 0.2);
}

.contact-icon {
    width: 22px;
    height: 22px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.contact-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--white-dim);
    font-weight: 500;
}

.contact-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    word-break: break-all;
    transition: var(--transition-smooth);
}

.contact-card:hover .contact-value {
    color: var(--white);
}

/* Social Footer */
.social-footer {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 24px;
}

.social-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white-muted);
    transition: var(--transition-smooth);
}

.social-icon-btn:hover {
    color: var(--white);
    background: var(--navy-accent);
    border-color: var(--navy-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 102, 255, 0.25);
}

.social-svg {
    width: 18px;
    height: 18px;
}

/* Page Footer styling */
.page-footer {
    position: relative;
    z-index: 2;
    text-align: center;
    animation: fadeIn 1s ease-out 0.4s both;
}

.page-footer p {
    font-size: 0.85rem;
    color: var(--white-dim);
    font-weight: 300;
}

/* CSS Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .glass-card {
        padding: 32px 24px;
        gap: 28px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .description {
        font-size: 1rem;
    }
    
    .contacts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .contact-card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 24px 16px;
    }
    
    .logo {
        height: 52px;
    }
    
    .title {
        font-size: 1.75rem;
    }
    
    .lang-switcher {
        align-self: center;
    }
}
