/* 
=================================================================
1. CSS VARIABLES & GLOBAL STYLES
=================================================================
Modify these variables to change the entire color scheme of the website
*/
:root {
    /* Primary Colors - Main brand colors */
    --primary-color: #1a1a2e;      /* Dark blue - main background */
    --secondary-color: #16213e;    /* Darker blue - card backgrounds */
    --accent-color: #0f3460;       /* Medium blue - accents */
    --highlight-color: #ea0000;    /* Red - CTAs and highlights */
    
    /* Text Colors */
    --text-light: #f5f5f5;         /* Light text for dark backgrounds */
    --text-dark: #333;             /* Dark text for light backgrounds */
    
    /* Gradient Effects - Used for buttons and text effects */
    --gradient-1: linear-gradient(135deg, #1161ff 0%, #990000 100%);  /* Bright blue to dark red gradient */
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);  /* Pink gradient */
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);  /* Blue gradient */
    --gradient-icon: linear-gradient(135deg, #ea0000 0%, #ea0000 20%, #ffffff 60%, #ffffff 100%);  /* Red to white gradient matching hero text */
    --gradient-icon-inverted: linear-gradient(135deg, #ffffff 0%, #ffffff 40%, #ea0000 75%, #ea0000 100%);  /* Inverted white to red gradient for SVG icons */
}

/* Global Reset - Ensures consistent styling across browsers */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #0a0a0a;
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Body style when mobile nav is open - prevents scrolling */
body.nav-open {
    overflow: hidden;
}

/* 
=================================================================
2. ANIMATIONS & BACKGROUND EFFECTS
=================================================================
*/

/* Fixed background image */
.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/data/ressources/cropped-CONNECTTECH.jpeg');
    background-size: cover;
    background-position: center;
    z-index: -3;
    opacity: 0.7; /* Adjust opacity as needed */
}

/* Animated gradient background - creates moving gradient effect */
.bg-animation {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -2;
    background: linear-gradient(45deg, rgba(10, 10, 10, 0.7), rgba(26, 26, 46, 0.7), rgba(15, 52, 96, 0.7));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Gradient animation keyframes */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Particles Container */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

@keyframes float {
    from {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    to {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 26, 46, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1.3rem 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

nav.scrolled {
    background: rgba(26, 26, 46, 0.3);
    padding: 0.65rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 52px;
    width: auto;
    max-width: 260px;
    object-fit: contain;
}

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

/* Main navigation area */
.nav-links-container {
    display: flex;
    align-items: center;
    margin-left: auto; /* Push to the right of the logo */
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin-right: 2rem; /* Space between nav links and language selector */
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.65rem 0;
}

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

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

/* Burger Menu */
.burger-menu {
    display: none;
    cursor: pointer;
    z-index: 1002;
}

.burger-menu div {
    width: 25px;
    height: 3px;
    background-color: var(--text-light);
    margin: 5px;
    transition: all 0.3s ease;
}

/* Mobile controls wrapper - contains burger and language selector */
.mobile-controls {
    display: flex;
    align-items: center;
    margin-left: auto;
}

/* Language Selector */
.language-selector {
    margin-left: auto; /* Always push to the right */
}

.language-toggle {
    display: flex;
    align-items: center;
    padding: 0.2rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    transition: all 0.3s ease;
}

.lang-btn.active {
    color: var(--highlight-color);
    font-weight: bold;
}

.lang-btn:hover:not(.active) {
    opacity: 0.7;
}

.lang-divider {
    color: var(--text-light);
    opacity: 0.5;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 20vh; /* This adds padding at the top to position the content in the upper half */
}

.hero-content {
    text-align: center;
    z-index: 3; /* Higher than news section to ensure visibility */
    animation: fadeInUp 1s ease;
}

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

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, 
                #ea0000 0%, 
                #ea0000 20%, 
                #ffffff 60%, 
                #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 10px rgba(234, 0, 0, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(234, 0, 0, 0.8)); }
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(17, 97, 255, 0.4);
    position: relative;
    z-index: 1;
    text-decoration: none;
    backdrop-filter: blur(5px);
}

.cta-button span {
    font-size: 1.1rem;
    font-weight: bold;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    mix-blend-mode: overlay;
    position: relative;
}

.cta-button::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    background: var(--gradient-icon);
    -webkit-background-clip: text;
    background-clip: text;
    z-index: 2;
    font-weight: bold;
    font-size: 1.1rem;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(153, 0, 0, 0.6);
    background: rgba(255, 255, 255, 0.25);
}

/* News Section */
.news-section {
    padding: 5rem 0;
    background: rgba(22, 33, 62, 0.5);
    margin-top: -40vh; /* This creates overlap with the hero section */
    position: relative;
    z-index: 2; /* Ensure it's above the hero background elements */
}

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

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, 
                #ea0000 0%, 
                #ea0000 20%, 
                #ffffff 60%, 
                #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.news-card {
    background: rgba(15, 52, 96, 0.3);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.news-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--highlight-color);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image {
    transform: scale(1.1);
}

.news-content {
    padding: 1.5rem;
}

.news-date {
    color: var(--highlight-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.news-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.news-excerpt {
    color: rgba(245, 245, 245, 0.8);
    line-height: 1.6;
}

/* Services Section */
.services-section {
    padding: 5rem 0;
}

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

.service-card {
    background: rgba(22, 33, 62, 0.5);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.service-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.service-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--highlight-color);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    position: relative;
    overflow: hidden;
}

.service-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-icon);
    z-index: 1;
    border-radius: 50%;
}

.service-icon div {
    position: relative;
    z-index: 2;
}

.service-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.service-description {
    text-align: left;
    color: rgba(245, 245, 245, 0.8);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.service-list {
    list-style: none;
    text-align: left;
    color: rgba(245, 245, 245, 0.8);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 1;
    padding-top: 50px; /* Add some top padding for better visual appearance */
    pointer-events: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--secondary-color);
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 800px;
    padding: 2rem;
    position: relative;
    margin-bottom: 50px;
    animation: slideIn 0.4s ease-out;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
}

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

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Article Modal Styles */
.modal-article-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Modal Content Inner - specific formatting for text content */
.modal-content-inner {
    line-height: 1.6;
    color: #ffffff;
    padding: 0 15px;
}

.modal-content-inner h3 {
    margin-top: 25px;
    margin-bottom: 10px;
    color: #ffffff;
}

.modal-content-inner p {
    margin-bottom: 15px;
    color: #ffffff;
}

.modal-content-inner ul {
    margin-left: 20px;
    margin-bottom: 15px;
    color: #ffffff;
}

.modal-content-inner li {
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.modal-content-inner a {
    color: var(--highlight-color);
    text-decoration: none;
}

.modal-content-inner a:hover {
    text-decoration: underline;
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-align: center;
}

/* Article/Service Modal Specific Styles */
.modal-article-title, 
.modal-service-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #ffffff;
    font-weight: 700;
    line-height: 1.3;
}

.modal-article-date {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
    opacity: 0.8;
    display: block;
}

.modal-article-content,
.modal-service-content {
    line-height: 1.6;
    color: #ffffff;
    padding: 0.5rem 0;
}

.modal-article-content p,
.modal-service-content p {
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.modal-article-content h2,
.modal-service-content h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: #ffffff;
}

.modal-article-content h3,
.modal-service-content h3 {
    font-size: 1.5rem;
    margin: 1.8rem 0 0.8rem;
    color: #ffffff;
}

.modal-article-content ul,
.modal-service-content ul {
    margin: 1rem 0 1.5rem 2rem;
    color: #ffffff;
}

.modal-article-content li,
.modal-service-content li {
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.modal-article-content strong,
.modal-service-content strong {
    color: #ffffff;
    font-weight: 600;
}

/* Loading state */
.loading {
    padding: 2rem;
    text-align: center;
    color: #aaa;
    font-style: italic;
}

.error {
    padding: 2rem;
    text-align: center;
    color: var(--highlight-color);
    background: rgba(234, 0, 0, 0.1);
    border-radius: 5px;
    margin: 1rem 0;
}

/* Footer */
footer {
    background: rgba(26, 26, 46, 0.3);
    backdrop-filter: blur(10px);
    padding: 3rem 0;
    text-align: center;
    margin-top: 5rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-text {
    color: rgba(245, 245, 245, 0.8);
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.footer-links a {
    color: #e41111;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--highlight-color);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .burger-menu {
        display: block;
        position: relative;
        z-index: 1010;
        margin-right: 15px; /* Space between burger and language selector */
    }
    
    .nav-links {
        position: absolute;
        right: 0;
        top: 100%; /* Position below the navbar */
        height: auto; /* Only as tall as needed */
        width: 200px; /* Fixed width dropdown */
        background: rgba(26, 26, 46, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start; /* Start from top */
        gap: 1.5rem;
        padding: 1.5rem;
        transform: translateX(100%); /* Move off-screen initially */
        transition: transform 0.3s ease;
        z-index: 1001;
        box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.2);
        margin-right: 0; /* Reset margin on mobile */
    }
    
    .nav-links.active {
        transform: translateX(0); /* Slide in from right */
    }
    
    .burger-menu.active .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .burger-menu.active .line2 {
        opacity: 0;
    }
    
    .burger-menu.active .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    .news-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .logo-image {
        height: 40px;
    }
    
    /* Keep language selector visible */
    .language-selector {
        position: static;
    }
    
    .language-toggle {
        background: rgba(26, 26, 46, 0.7);
    }
    
    /* Remove previous top margin since we're using proper positioning now */
    .nav-links li:first-child {
        margin-top: 0;
    }
    
    /* Give some space between nav links */
    .nav-links li {
        margin: 0.5rem 0;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .cta-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Further adjustments for very small screens */
    .logo-image {
        height: 36px;
    }
    
    .language-toggle {
        padding: 0.1rem 0.6rem;
    }
    
    .lang-btn {
        font-size: 12px;
        padding: 3px 6px;
    }
    
    /* Adjust space between burger and language selector on smallest screens */
    .language-selector {
        margin-left: 10px;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--primary-color);
}

::-webkit-scrollbar-thumb {
    background: var(--highlight-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff3333;
}

/* Loading animation for articles */
.loading-articles {
    text-align: center;
    padding: 3rem;
    grid-column: 1 / -1;
    color: var(--text-light);
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    position: relative;
}

.loading-articles::after {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--highlight-color);
    margin: 1rem auto 0;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Contact Form Styles */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #ffffff;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}

.submit-btn {
    background: var(--highlight-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    display: block;
    margin: 0 auto;
}

.submit-btn:hover {
    background: #c00000;
}

.form-status {
    margin: 15px 0;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.form-status.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-status.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.privacy-link {
    color: var(--highlight-color);
    text-decoration: none;
    cursor: pointer;
}

.privacy-link:hover {
    text-decoration: underline;
}

/* Honeypot field - hidden from humans but visible to bots */
.website-field {
    display: none !important;
    opacity: 0;
    position: absolute;
    left: -9999px;
}

/* Add styling for the service modal image */
.modal-service-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    margin-bottom: 20px;
    border-radius: 5px;
} 