/**
 * TuroTuro Theme - Additional Styles
 *
 * Styles supplementaires pour les overlays, navigation mobile,
 * et composants interactifs.
 *
 * @package TuroTuro
 * @since 1.0.0
 */

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
.tt-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(45, 45, 45, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tt-search-overlay--open {
    opacity: 1;
    visibility: visible;
}

.tt-search-overlay__inner {
    width: 100%;
    max-width: 700px;
    padding: 0 24px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.tt-search-overlay--open .tt-search-overlay__inner {
    transform: translateY(0);
}

.tt-search-overlay__close {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tt-search-overlay__close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.tt-search-overlay__close svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.tt-search-overlay__form {
    display: flex;
    gap: 16px;
}

.tt-search-overlay__input {
    flex: 1;
    padding: 20px 28px;
    font-size: 1.125rem;
    font-family: inherit;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.tt-search-overlay__input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.tt-search-overlay__input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.15);
}

.tt-search-overlay__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: var(--tt-sage);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.tt-search-overlay__submit:hover {
    background-color: var(--tt-sage-dark);
    transform: scale(1.05);
}

.tt-search-overlay__submit svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

/* ============================================================
   MOBILE NAVIGATION ENHANCED
   ============================================================ */
.tt-mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background-color: var(--tt-surface-primary);
    display: flex;
    flex-direction: column;
    padding: 100px 24px 40px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

.tt-mobile-nav--open {
    transform: translateX(0);
}

.tt-mobile-nav__close {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: var(--tt-surface-accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tt-mobile-nav__close:hover {
    background-color: var(--tt-border-strong);
}

.tt-mobile-nav__close svg {
    width: 20px;
    height: 20px;
    color: var(--tt-text-primary);
}

.tt-mobile-nav__link {
    display: block;
    padding: 20px 0;
    font-family: var(--tt-font-display);
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--tt-text-primary);
    border-bottom: 1px solid var(--tt-border);
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.tt-mobile-nav__link:hover {
    color: var(--tt-sage);
    padding-left: 12px;
}

.tt-mobile-nav__link:first-child {
    border-top: 1px solid var(--tt-border);
}

/* ============================================================
   MENU TOGGLE ANIMATION
   ============================================================ */
.tt-menu-toggle {
    position: relative;
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1600;
}

.tt-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--tt-text-primary);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 2px;
}

.tt-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.tt-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.tt-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .tt-menu-toggle {
        display: block;
    }
}

/* ============================================================
   LOADING STATES
   ============================================================ */
.tt-loading {
    position: relative;
    pointer-events: none;
}

.tt-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.tt-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--tt-border);
    border-top-color: var(--tt-sage);
    border-radius: 50%;
    animation: tt-spin 0.8s linear infinite;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.tt-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    padding: 16px 24px;
    background-color: var(--tt-charcoal);
    color: var(--tt-text-light);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.tt-toast--visible {
    transform: translateY(0);
    opacity: 1;
}

.tt-toast--success {
    background-color: #059669;
}

.tt-toast--error {
    background-color: #dc2626;
}

/* ============================================================
   SKIP LINK (Accessibility)
   ============================================================ */
.tt-skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 12px 24px;
    background-color: var(--tt-sage);
    color: var(--tt-text-light);
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    transition: top 0.2s ease;
}

.tt-skip-link:focus {
    top: 0;
}

/* ============================================================
   FOCUS STYLES (Accessibility)
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--tt-sage);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--tt-sage);
    outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================================
   SELECTION STYLES
   ============================================================ */
::selection {
    background-color: var(--tt-sage);
    color: var(--tt-text-light);
}

::-moz-selection {
    background-color: var(--tt-sage);
    color: var(--tt-text-light);
}

/* ============================================================
   SCROLLBAR STYLES
   ============================================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--tt-surface-secondary);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--tt-sage-light);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--tt-border-strong) var(--tt-surface-secondary);
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@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;
    }
}

/* ============================================================
   HIGH CONTRAST MODE
   ============================================================ */
@media (prefers-contrast: high) {
    :root {
        --tt-border: rgba(0, 0, 0, 0.3);
        --tt-border-strong: rgba(0, 0, 0, 0.5);
    }
    
    .tt-btn--primary {
        border: 2px solid var(--tt-text-light);
    }
    
    .tt-card {
        border: 2px solid var(--tt-border-strong);
    }
}
