/* Style Linux Terminal + Papier Ancien + Animation 3D Three.js */
/* Teinturerie El Oumnia - Casablanca, Maroc */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', 'Monaco', 'Consolas', 'Ubuntu Mono', monospace;
    color: #2c3e50;
    line-height: 1.7;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Canvas Three.js en arrière-plan */
#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Overlay Matrix pour effet supplémentaire */
#matrix-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(244, 236, 216, 0.3) 100%
    );
}

.container {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 40px;
    
    /* Fond avec effet glassmorphism */
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    border: 3px solid rgba(52, 73, 94, 0.8);
    border-radius: 8px;
    box-shadow: 
        0 0 0 1px rgba(52, 73, 94, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    
    animation: containerFadeIn 1s ease-out;
}

@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Effet glow au survol du container */
.container:hover {
    box-shadow: 
        0 0 0 1px rgba(52, 73, 94, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(39, 174, 96, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: box-shadow 0.5s ease;
}

.emoji {
    font-size: 72px;
    margin-bottom: 25px;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(39, 174, 96, 0.3);
    filter: drop-shadow(0 4px 8px rgba(52, 73, 94, 0.2));
    animation: emojiFloat 3s ease-in-out infinite;
}

@keyframes emojiFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.name {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1a252f;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 3px double #34495e;
    padding-bottom: 10px;
    font-family: 'Courier New', monospace;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow: 0 0 5px rgba(39, 174, 96, 0.3);
    }
    to {
        text-shadow: 0 0 15px rgba(39, 174, 96, 0.6);
    }
}

.updated {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    padding: 5px 10px;
    background: rgba(127, 140, 141, 0.15);
    border-left: 3px solid #95a5a6;
    display: inline-block;
    animation: blinkBorder 2s ease-in-out infinite;
}

@keyframes blinkBorder {
    0%, 100% {
        border-left-color: #95a5a6;
    }
    50% {
        border-left-color: #27ae60;
    }
}

.content {
    font-size: 16px;
    color: #2c3e50;
    letter-spacing: 0.3px;
}

.content p {
    margin-bottom: 22px;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease-out backwards;
}

.content p:nth-child(1) { animation-delay: 0.1s; }
.content p:nth-child(2) { animation-delay: 0.2s; }
.content p:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Liens avec effet néon */
.link {
    color: #27ae60;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    padding: 2px 4px;
    background: rgba(39, 174, 96, 0.05);
    position: relative;
}

.link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(39, 174, 96, 0.1);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    z-index: -1;
}

.link:hover::before {
    transform: scaleX(1);
}

.link:hover {
    color: #229954;
    border-bottom: 2px solid #27ae60;
    text-shadow: 0 0 8px rgba(39, 174, 96, 0.5);
}

.clients-intro {
    color: #34495e;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
    margin-top: 10px;
    position: relative;
    padding-left: 20px;
}

.clients-intro::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: #27ae60;
    font-size: 12px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.clients {
    color: #34495e;
    background: rgba(236, 240, 241, 0.6);
    padding: 15px;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.9;
    transition: all 0.3s ease;
}

.clients:hover {
    background: rgba(236, 240, 241, 0.9);
    border-left-color: #27ae60;
    transform: translateX(5px);
}

/* Section carte Maps avec effet 3D */
.map-section {
    margin: 35px 0;
    border: 3px solid #34495e;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.map-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.map-container {
    width: 100%;
    height: 400px;
    position: relative;
    background: #ecf0f1;
}

.map-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Bloc localisation avec effet glassmorphism */
.location-info {
    background: rgba(236, 240, 241, 0.7);
    backdrop-filter: blur(5px);
    padding: 25px;
    border-radius: 6px;
    margin: 35px 0;
    border: 2px solid #95a5a6;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.05),
        0 0 20px rgba(39, 174, 96, 0.1);
    transition: all 0.3s ease;
}

.location-info:hover {
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.05),
        0 0 30px rgba(39, 174, 96, 0.3);
}

.location-info h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #1a252f;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid #34495e;
    padding-bottom: 10px;
    font-weight: 700;
}

.location-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: #2c3e50;
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    border-left: 3px solid #27ae60;
    transition: all 0.3s ease;
}

.location-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
}

.location-item-icon {
    font-size: 18px;
    min-width: 24px;
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.location-item a {
    color: #27ae60;
    text-decoration: none;
    font-weight: 600;
}

.location-item a:hover {
    color: #229954;
    text-decoration: underline;
}

.location-item strong {
    color: #1a252f;
}

/* Bouton itinéraire avec effet néon */
.directions-btn {
    display: inline-block;
    background: #27ae60;
    color: white;
    padding: 12px 28px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    margin-top: 18px;
    transition: all 0.3s;
    border: 2px solid #229954;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    box-shadow: 
        0 4px 8px rgba(39, 174, 96, 0.3),
        0 0 20px rgba(39, 174, 96, 0.2);
    position: relative;
    overflow: hidden;
}

.directions-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.directions-btn:hover::before {
    width: 300px;
    height: 300px;
}

.directions-btn:hover {
    background: #229954;
    transform: translateY(-3px);
    box-shadow: 
        0 6px 12px rgba(39, 174, 96, 0.4),
        0 0 40px rgba(39, 174, 96, 0.4);
}

/* Réseaux sociaux */
.social {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 30px 0;
    padding: 20px;
    background: rgba(52, 73, 94, 0.05);
    border-radius: 6px;
    border: 2px dashed #95a5a6;
}

.social-link {
    color: #2980b9;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s;
    width: fit-content;
    padding: 8px 12px;
    border-left: 3px solid #2980b9;
    background: rgba(41, 128, 185, 0.05);
    font-weight: 600;
}

.social-link:hover {
    color: #21618c;
    background: rgba(41, 128, 185, 0.15);
    transform: translateX(10px);
    border-left-color: #21618c;
    box-shadow: 0 0 15px rgba(41, 128, 185, 0.3);
}

.time {
    color: #7f8c8d;
    font-size: 14px;
    margin-top: 30px;
    padding: 10px 15px;
    background: rgba(127, 140, 141, 0.1);
    border-radius: 4px;
    border-left: 4px solid #95a5a6;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.time::before {
    content: '⏰ ';
    font-size: 16px;
}

strong {
    color: #c0392b;
    font-weight: 700;
    background: rgba(192, 57, 43, 0.08);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 40px 25px;
        border-width: 2px;
    }
    
    .emoji {
        font-size: 56px;
        margin-bottom: 20px;
    }
    
    .name {
        font-size: 28px;
        letter-spacing: 1px;
    }
    
    .content {
        font-size: 15px;
    }
    
    .map-container {
        height: 300px;
    }
    
    .location-info {
        padding: 20px;
    }
    
    .directions-btn {
        width: 100%;
        text-align: center;
    }
}

/* Sélection style terminal */
::selection {
    background: #27ae60;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

::-moz-selection {
    background: #27ae60;
    color: white;
}

/* Scrollbar avec effet néon */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(236, 240, 241, 0.5);
}

::-webkit-scrollbar-thumb {
    background: #95a5a6;
    border-radius: 6px;
    box-shadow: inset 0 0 6px rgba(39, 174, 96, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: #7f8c8d;
    box-shadow: inset 0 0 10px rgba(39, 174, 96, 0.5);
}

/* ==========================================
   SÉLECTEUR DE LANGUE
   ========================================== */

.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 8px;
    border: 2px solid rgba(52, 73, 94, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideInFromTop 0.6s ease-out;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(236, 240, 241, 0.6);
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #2c3e50;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.lang-flag {
    font-size: 18px;
    line-height: 1;
}

.lang-text {
    font-size: 12px;
}

.lang-btn:hover {
    background: rgba(236, 240, 241, 1);
    border-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.lang-btn.active {
    background: #27ae60;
    color: white;
    border-color: #229954;
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.4);
}

.lang-btn.active:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.5);
}

/* ==========================================
   SUPPORT RTL POUR L'ARABE
   ========================================== */

/* Repositionner le sélecteur de langue en mode RTL */
body.rtl .language-selector {
    right: auto;
    left: 20px;
}

/* Ajustement des bordures en mode RTL */
body.rtl .clients,
body.rtl .location-item {
    border-left: none;
    border-right: 4px solid #3498db;
}

body.rtl .location-item {
    border-right-color: #27ae60;
}

body.rtl .clients:hover {
    border-right-color: #27ae60;
    transform: translateX(-5px);
}

body.rtl .location-item:hover {
    transform: translateX(-5px);
}

body.rtl .social-link {
    border-left: none;
    border-right: 3px solid #2980b9;
}

body.rtl .social-link:hover {
    border-right-color: #21618c;
    transform: translateX(-10px);
}

body.rtl .updated {
    border-left: none;
    border-right: 3px solid #95a5a6;
}

body.rtl .time {
    border-left: none;
    border-right: 4px solid #95a5a6;
}

/* Ajuster les icônes en mode RTL */
body.rtl .clients-intro::before {
    content: '◀';
    left: auto;
    right: 0;
}

body.rtl .clients-intro {
    padding-left: 0;
    padding-right: 20px;
}

/* Police arabe améliorée */
body.rtl {
    font-family: 'Traditional Arabic', 'Arabic Typesetting', 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
}

body.rtl .name {
    font-family: 'Traditional Arabic', 'Arabic Typesetting', 'Segoe UI', 'Courier New', monospace;
    letter-spacing: 0;
}

/* Améliorer la lisibilité de l'arabe */
body.rtl .content {
    line-height: 2;
}

body.rtl .content p {
    text-align: right;
}

body.rtl .location-details {
    text-align: right;
}

/* Bouton directions en mode RTL */
body.rtl .directions-btn {
    direction: rtl;
}

/* Responsive pour le sélecteur de langue */
@media (max-width: 768px) {
    .language-selector {
        top: 10px;
        right: 10px;
        padding: 6px;
        gap: 6px;
    }
    
    body.rtl .language-selector {
        right: auto;
        left: 10px;
    }
    
    .lang-btn {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .lang-flag {
        font-size: 16px;
    }
    
    .lang-text {
        display: none;
    }
}