/* ============================================
   Custom Styles for Cloud Solution Architect Portfolio
   ============================================ */

/* CSS Variables */
:root {
    --color-background: #fffcf3;
    --color-foreground: #f89576;
    --color-accent1: #5fa9c0;
    --color-accent2: #92a2a7;
    --color-accent3: #c59c8f;
}

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

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--color-foreground);
}

/* Navigation Scroll Effect */
#navbar.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.nav-link {
    position: relative;
}

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Parallax Effect */
.parallax-bg {
    transform: translateY(0);
    transition: transform 0.3s ease-out;
}

.parallax-layer {
    transform: translateY(0);
    transition: transform 0.3s ease-out;
}

/* Scroll Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger animation for cards */
.expertise-card,
.realisation-card {
    transition-delay: 0s;
}

.expertise-card:nth-child(1),
.realisation-card:nth-child(1) {
    transition-delay: 0.1s;
}

.expertise-card:nth-child(2),
.realisation-card:nth-child(2) {
    transition-delay: 0.2s;
}

.expertise-card:nth-child(3),
.realisation-card:nth-child(3) {
    transition-delay: 0.3s;
}

.expertise-card:nth-child(4),
.realisation-card:nth-child(4) {
    transition-delay: 0.4s;
}

/* Button Styles */
.btn-primary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-secondary {
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(95, 169, 192, 0.1), transparent);
    transition: left 0.5s;
}

.btn-secondary:hover::before {
    left: 100%;
}

.btn-tertiary {
    position: relative;
    overflow: hidden;
}

/* Card Hover Effects */
.expertise-card {
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.expertise-card:hover {
    transform: translateY(-8px);
}

.realisation-card {
    transform: translateY(0);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.realisation-card:hover {
    transform: translateY(-5px);
}

/* Modal Styles */
.modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Modal Body with Internal Scroll */
.modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #5fa9c0 transparent;
}

/* Custom scrollbar for modal (WebKit browsers) - Style identique au chatbot */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #5fa9c0;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #f89576;
}

/* Firefox scrollbar */
.modal-body {
    scrollbar-width: thin;
    scrollbar-color: #5fa9c0 transparent;
}

.modal-close {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.modal-close:hover {
    transform: rotate(90deg);
}

/* Modal Animation */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.95) translateY(-20px);
    }
    to {
        transform: scale(1) translateY(0);
    }
}

.modal-overlay.show {
    animation: modalFadeIn 0.3s ease-out;
}

.modal-overlay.show .modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

/* Form Styles */
input:focus,
textarea:focus {
    outline: none;
}

input,
textarea {
    font-family: 'Roboto', sans-serif;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        margin: 1rem;
    }

    .modal-body {
        max-height: 70vh;
    }

    .fade-in-up,
    .fade-in-left,
    .fade-in-right {
        opacity: 1;
        transform: none;
    }
}

/* Gradient Text Effect */
.gradient-text {
    background: linear-gradient(135deg, var(--color-accent1), var(--color-foreground));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Pulse Animation for CTA */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--color-accent1);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transitions for all interactive elements */
a, button, input, textarea {
    transition: all 0.3s ease;
}

/* Image Lazy Load Effect */
img {
    transition: opacity 0.3s ease;
}

img.loading {
    opacity: 0.5;
}

img.loaded {
    opacity: 1;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles */
*:focus-visible {
    outline: 2px solid var(--color-accent1);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .modal-overlay,
    nav,
    footer {
        display: none;
    }

    body {
        color: #000;
        background: #fff;
    }
}

/* reCAPTCHA Mobile Responsive Styles */
.recaptcha-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Desktop: reCAPTCHA normal size */
.g-recaptcha {
    display: inline-block;
}

/* Tablets and medium screens */
@media (max-width: 768px) {
    .recaptcha-wrapper {
        transform: scale(0.95);
        transform-origin: center center;
    }
}

/* Mobile: Scale down reCAPTCHA for small screens */
@media (max-width: 480px) {
    .recaptcha-wrapper {
        transform: scale(0.88);
        transform-origin: center center;
    }
}

/* Small mobile screens */
@media (max-width: 380px) {
    .recaptcha-wrapper {
        transform: scale(0.8);
        transform-origin: center center;
    }
}

/* Very small screens: Further scale down */
@media (max-width: 320px) {
    .recaptcha-wrapper {
        transform: scale(0.72);
        transform-origin: center center;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .parallax-bg,
    .parallax-layer {
        transform: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn-primary,
    .btn-secondary,
    .btn-tertiary {
        border: 2px solid currentColor;
    }
}

/* Dark Mode Support (if needed in the future) */
@media (prefers-color-scheme: dark) {
    /* Can be implemented if dark mode is required */
}

/* ============================================
   CV Modal Specific Styles
   ============================================ */

/* Skill Bar Animations */
.skill-bar {
    width: 0;
    transition: width 1s ease-out;
}

.skill-bar.animated {
    width: var(--skill-width);
}

/* Timeline Animations */
.fade-in-timeline {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-timeline.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger animation for timeline items */
.timeline-item:nth-child(1) {
    transition-delay: 0.1s;
}

.timeline-item:nth-child(2) {
    transition-delay: 0.2s;
}

.timeline-item:nth-child(3) {
    transition-delay: 0.3s;
}

.timeline-item:nth-child(4) {
    transition-delay: 0.4s;
}

.timeline-item:nth-child(5) {
    transition-delay: 0.5s;
}

.timeline-item:nth-child(6) {
    transition-delay: 0.6s;
}

/* CV Section Spacing */
.cv-section {
    scroll-margin-top: 2rem;
}

/* Timeline Pulse Animation for Dots */
@keyframes timeline-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(95, 169, 192, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(95, 169, 192, 0);
    }
}

.timeline-item:first-child span {
    animation: timeline-pulse 2s infinite;
}

/* Custom Utilities */
.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.text-shadow-sm {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.text-shadow-md {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.text-shadow-lg {
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* ============================================
   RGPD Banner Styles
   ============================================ */

.rgpd-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 2px solid var(--color-accent1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rgpd-banner.show {
    transform: translateY(0);
}

.rgpd-banner.hidden {
    display: block;
}

.rgpd-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.rgpd-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-accent1) 0%, var(--color-foreground) 100%);
    border-radius: 12px;
    color: white;
}

.rgpd-text {
    flex: 1;
    min-width: 0;
}

.rgpd-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent1);
    margin-bottom: 0.25rem;
}

.rgpd-description {
    font-family: 'Roboto', sans-serif;
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
}

.rgpd-link {
    background: none;
    border: none;
    color: var(--color-accent1);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.rgpd-link:hover {
    color: var(--color-foreground);
}

.rgpd-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.75rem;
}

.rgpd-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.rgpd-btn-accept {
    background: linear-gradient(135deg, var(--color-accent1) 0%, var(--color-foreground) 100%);
    color: white;
}

.rgpd-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(95, 169, 192, 0.4);
}

.rgpd-btn-decline {
    background: transparent;
    color: var(--color-accent2);
    border: 1.5px solid var(--color-accent2);
}

.rgpd-btn-decline:hover {
    background: var(--color-accent2);
    color: white;
    transform: translateY(-2px);
}

/* Animation d'entrée de la bannière */
@keyframes rgpd-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.rgpd-banner.show {
    animation: rgpd-slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive Design pour mobile */
@media (max-width: 768px) {
    .rgpd-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        gap: 1rem;
    }

    .rgpd-icon {
        width: 40px;
        height: 40px;
    }

    .rgpd-text {
        width: 100%;
    }

    .rgpd-title {
        font-size: 0.9375rem;
    }

    .rgpd-description {
        font-size: 0.8125rem;
    }

    .rgpd-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .rgpd-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
    }
}

/* Responsive Design pour petits écrans */
@media (max-width: 480px) {
    .rgpd-content {
        padding: 0.875rem;
    }

    .rgpd-icon {
        display: none;
    }

    .rgpd-title {
        font-size: 0.875rem;
    }

    .rgpd-description {
        font-size: 0.75rem;
    }
}
