/* Robot Ultrasonique - Styles CSS */

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.7; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 1; }
}

@keyframes sonar-sweep {
    0% { 
        transform: rotate(0deg) scale(1); 
        opacity: 0.3; 
        border-width: 1px;
    }
    50% { 
        transform: rotate(180deg) scale(1.1); 
        opacity: 0.2; 
        border-width: 1px;
    }
    100% { 
        transform: rotate(360deg) scale(1.2); 
        opacity: 0; 
        border-width: 0px;
    }
}

@keyframes sonar-pulse {
    0% { 
        transform: scale(0.5); 
        opacity: 0.4; 
        border-width: 1px;
    }
    50% { 
        transform: scale(1.5); 
        opacity: 0.2; 
        border-width: 1px;
    }
    100% { 
        transform: scale(2.5); 
        opacity: 0; 
        border-width: 0px;
    }
}

@keyframes sonar-reflection {
    0% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.3; 
        border-width: 1px;
    }
    100% { 
        transform: scale(0.3) rotate(180deg); 
        opacity: 0; 
        border-width: 0px;
    }
}

@keyframes bat-emission {
    0% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.8; 
    }
    50% { 
        transform: scale(1.1) rotate(5deg); 
        opacity: 1; 
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.8; 
    }
}

@keyframes bat-reception {
    0% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.6; 
    }
    50% { 
        transform: scale(1.2) rotate(-5deg); 
        opacity: 1; 
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.6; 
    }
}

@keyframes sound-wave {
    0% { 
        transform: scale(0.5); 
        opacity: 0.8; 
        border-width: 2px;
    }
    50% { 
        transform: scale(1.5); 
        opacity: 0.4; 
        border-width: 1px;
    }
    100% { 
        transform: scale(2.5); 
        opacity: 0; 
        border-width: 0px;
    }
}

@keyframes arc-wave {
    0% { 
        transform: translate(0, 0) scale(0.5) rotate(0deg); 
        opacity: 0.8; 
        border-width: 2px;
    }
    50% { 
        transform: translate(calc(var(--target-x) * 0.5), calc(var(--target-y) * 0.5)) scale(1.0) rotate(45deg); 
        opacity: 0.6; 
        border-width: 1px;
    }
    100% { 
        transform: translate(var(--target-x), var(--target-y)) scale(1.2) rotate(90deg); 
        opacity: 0; 
        border-width: 0px;
    }
}

@keyframes arc-reflection {
    0% { 
        transform: translate(0, 0) scale(0.5) rotate(0deg); 
        opacity: 0.6; 
        border-width: 2px;
    }
    50% { 
        transform: translate(calc(var(--target-x) * 0.5), calc(var(--target-y) * 0.5)) scale(0.8) rotate(-45deg); 
        opacity: 0.4; 
        border-width: 1px;
    }
    100% { 
        transform: translate(var(--target-x), var(--target-y)) scale(1.0) rotate(-90deg); 
        opacity: 0; 
        border-width: 0px;
    }
}

/* Background gradient */
.sky-gradient {
    background: radial-gradient(ellipse at center, 
        rgba(26, 13, 46, 0.8) 0%, 
        rgba(45, 27, 61, 0.9) 30%, 
        rgba(10, 10, 10, 1) 100%);
}

/* Sonar system classes */
.sonar-sweep {
    position: absolute;
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 50%;
    animation: sonar-sweep 8s linear infinite;
    pointer-events: none;
    z-index: 1;
    transform-origin: center;
}

.sonar-pulse {
    position: absolute;
    border: 1px solid rgba(64, 224, 208, 0.3);
    border-radius: 50%;
    animation: sonar-pulse 3s ease-out;
    pointer-events: none;
    z-index: 2;
}

.sonar-reflection {
    position: absolute;
    border: 1px solid rgba(57, 255, 20, 0.2);
    border-radius: 50%;
    animation: sonar-reflection 2s ease-out;
    pointer-events: none;
    z-index: 2;
}

/* Bat animation classes */
.bat-animation {
    position: absolute;
    font-size: 3rem;
    animation: bat-emission 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
}

.bat-receiving {
    position: absolute;
    font-size: 3rem;
    animation: bat-reception 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
}

.sound-wave {
    position: absolute;
    border: 2px solid rgba(255, 107, 53, 0.6);
    border-radius: 50%;
    animation: sound-wave 2s ease-out;
    pointer-events: none;
    z-index: 2;
}

.arc-wave {
    position: absolute;
    border: 2px solid rgba(255, 107, 53, 0.7);
    border-radius: 50%;
    border-top: none;
    border-left: none;
    animation: arc-wave 2s ease-out;
    pointer-events: none;
    z-index: 2;
    transform-origin: center;
}

.arc-reflection {
    position: absolute;
    border: 2px solid rgba(64, 224, 208, 0.6);
    border-radius: 50%;
    border-bottom: none;
    border-right: none;
    animation: arc-reflection 1.5s ease-out;
    pointer-events: none;
    z-index: 2;
    transform-origin: center;
}

/* Popup styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: linear-gradient(135deg, #1a0d2e 0%, #2d1b3d 100%);
    border: 2px solid #ff6b35;
    border-radius: 15px;
    padding: 2rem;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #ff6b35;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.popup-close:hover {
    color: #ff8c42;
}

.info-btn {
    cursor: pointer;
    font-size: 1.2rem;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

/* Animation d'écho pour la conclusion */
@keyframes echo-expand {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
        border-width: 2px;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.4;
        border-width: 1px;
    }
    100% {
        transform: scale(2);
        opacity: 0;
        border-width: 0px;
    }
}

.echo-wave {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px solid #ff6b35;
    border-radius: 50%;
    animation: echo-expand 2s infinite ease-out;
}

.echo-wave-1 {
    animation-delay: 0s;
}

.echo-wave-2 {
    animation-delay: 0.7s;
}

.echo-wave-3 {
    animation-delay: 1.4s;
}

/* Animation d'écho mini pour le menu */
.echo-wave-mini {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 1px solid #ff6b35;
    border-radius: 50%;
    animation: echo-expand 1.5s infinite ease-out;
}

.echo-wave-mini-1 {
    animation-delay: 0s;
}

.echo-wave-mini-2 {
    animation-delay: 0.5s;
}

/* Améliorations responsive mobile */
@media (max-width: 640px) {
    .component-card {
        padding: 1rem;
    }
    
    .example-card {
        padding: 1.5rem;
    }
    
    .popup-content {
        margin: 1rem;
        padding: 1.5rem;
        max-width: calc(100vw - 2rem);
    }
    
    .font-creepster {
        line-height: 1.1;
    }
    
    .echo-wave {
        width: 40px;
        height: 40px;
    }
    
    .echo-wave-mini {
        width: 20px;
        height: 20px;
    }
    
    /* Menu mobile */
    #mobile-menu {
        animation: slideDown 0.3s ease-out;
    }
    
    #mobile-menu.hidden {
        animation: slideUp 0.3s ease-out;
    }
    
    /* Navigation mobile */
    nav {
        backdrop-filter: blur(10px);
    }
    
    /* Espacement mobile */
    .slide {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    /* Titres mobile */
    h1, h2 {
        word-break: break-word;
    }
    
    /* Navigation mobile */
    nav h1 {
        font-size: 0.875rem;
        line-height: 1.2;
    }
    
    /* Espacement mobile navigation */
    nav .flex.items-center {
        gap: 0.25rem;
    }
}

/* Améliorations pour très petits écrans */
@media (max-width: 480px) {
    .component-card {
        padding: 0.75rem;
    }
    
    .example-card {
        padding: 1rem;
    }
    
    .popup-content {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .nav-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Animations pour le menu mobile */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Améliorations pour les grilles sur mobile */
@media (max-width: 640px) {
    .grid {
        gap: 1rem;
    }
    
    .step-card {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .flex.space-x-8 {
        flex-direction: column;
        space-x: 0;
        gap: 1rem;
    }
    
    .flex.space-x-8 > div {
        margin: 0.5rem 0;
    }
    
    /* Indicateurs de slide sur mobile */
    .slide-indicator {
        width: 0.75rem;
        height: 0.75rem;
    }
    
    /* Masquer les indicateurs sur très petits écrans */
    @media (max-width: 480px) {
        .slide-indicator {
            display: none;
        }
    }
}
