/* Variables CSS pour le thème */
:root {
    --background: #ffffff;
    --text-color: #1a1a1a;
    --text-muted: #6e6e6e;
    --border-color: #e5e7eb;
    --hover-background: #f3f4f6;
    --primary-color: #2563eb;
    --primary-color-dark: #1d4ed8;
    --primary-rgb: 37, 99, 235;
}

/* Thème sombre */
.dark-mode {
    --background: #1a1a1a;
    --text-color: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #404040;
    --hover-background: #2d2d2d;
    --primary-color: #3b82f6;
    --primary-color-dark: #2563eb;
    --primary-rgb: 59, 130, 246;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

/* Logo et marque */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-brand:hover {
    color: var(--primary-color);
}

.navbar-logo {
    height: 32px;
    width: auto;
}

/* Recherche */
.navbar-search {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-container {
    position: relative;
    width: 100%;
}

#doc-search {
    width: 100%;
    height: 40px;
    padding: 0 16px;
    padding-right: 44px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--background);
    color: var(--text-color);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

#doc-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    color: var(--text-color);
    background: var(--hover-background);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-result {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result:last-child {
    border-bottom: none;
}

.search-result:hover {
    background: var(--hover-background);
}

.search-highlight {
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.dark-mode .search-highlight {
    animation: dark-highlight-pulse 2s ease-in-out;
}

@keyframes dark-highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

/* Actions de droite */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Styles pour le bouton d'export */
.export-wrapper {
    position: relative;
    margin-right: 1rem;
    z-index: 9999;
}

.export-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    z-index: 9999;
}

/* Menu d'export */
.export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    z-index: 10000;
    min-width: 160px;
    transform: translateY(-10px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.export-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-menu button {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.export-menu button:hover {
    background-color: var(--hover-color);
}

.export-menu button:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.export-dropdown {
    position: relative;
}

.export-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-dropdown-toggle:hover {
    background: var(--primary-color-dark);
}

.export-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.export-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-item {
    display: block;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.export-item:hover {
    background: var(--hover-background);
    color: var(--primary-color);
    text-decoration: none;
}

/* Bouton de thème */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--hover-background);
    border-color: var(--text-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

.dark-mode .sun-icon {
    display: block;
}

.dark-mode .moon-icon {
    display: none;
}

/* Styles du bouton copier */
.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #e1e1e1;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.copy-button:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
}

.copy-button.copied {
    background-color: rgba(46, 160, 67, 0.15);
    border-color: rgba(46, 160, 67, 0.4);
    color: #2ea043;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-content {
        padding: 0 16px;
    }

    .navbar-search {
        display: none;
    }

    .export-dropdown-toggle span {
        display: none;
    }

    .export-dropdown-toggle {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .navbar-brand span {
        display: none;
    }
}
