/* Responsive Design */

/* Styles pour les boutons de thème */
.theme-btn {
    border: 1.5px solid var(--border-color);
    opacity: 0.7;
    transition: all 0.2s ease;
}

/* Style pour le bouton flottant de thème */
.floating-button.theme {
    background: var(--note-bg);
    color: var(--text-color);
}

/* En mode clair */
body:not([data-theme="dark"]) .floating-button.theme {
    background: var(--note-bg);
    color: #333333;
}

/* En mode sombre */
[data-theme="dark"] .floating-button.theme {
    background: var(--note-bg);
    color: #ffffff;
}

/* Style spécifique pour l'icône en mode sombre */
[data-theme="dark"] .floating-button.theme i {
    color: #ffffff;
}

/* Style spécifique pour le bouton mode clair */
#themeLightBtn {
    background: #ffffff;
    color: #333333;
}

#themeLightBtn:hover {
    background: #f5f5f5;
    border-color: var(--primary-color);
    opacity: 1;
}

/* Style spécifique pour le bouton mode sombre */
#themeDarkBtn {
    background: #333333;
    color: #ffffff;
}

#themeDarkBtn:hover {
    background: #444444;
    border-color: var(--primary-color);
    opacity: 1;
}

/* Mode clair actif */
[data-theme="light"] #themeLightBtn,
body:not([data-theme="dark"]) #themeLightBtn {
    opacity: 1;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

/* Mode sombre actif */
[data-theme="dark"] #themeDarkBtn {
    opacity: 1;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

/* Grands écrans */
@media (min-width: 1600px) {
    .note-view, .editor-container {
        max-width: 1400px;
    }
    
    .sidebar {
        width: 320px;
    }
}

/* Tablettes et petits écrans */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-content {
        height: 60vh;
    }
    
    .note-view {
        margin: 1rem;
        padding: 1.5rem;
        max-width: calc(100% - 2rem);
    }
    
    .editor-container {
        margin: 1rem;
        padding: 1.5rem;
        max-width: calc(100% - 2rem);
    }
    
    .custom-folders-panel {
        left: auto;
        right: 0;
        width: 280px;
        border-radius: 12px 0 0 12px;
    }
    
    .floating-buttons {
        bottom: 1rem;
        right: 1rem;
    }
}

/* Mobiles */
@media (max-width: 768px) {
    .sidebar {
        max-height: 45vh;
    }
    
    .main-content {
        height: 55vh;
    }
    
    .note-view {
        margin: 0.5rem;
        padding: 1rem;
        max-width: calc(100% - 1rem);
    }
    
    .note-view h1 {
        font-size: 1.8rem;
    }
    
    .editor-container {
        margin: 0.5rem;
        padding: 1rem;
        max-width: calc(100% - 1rem);
    }
    
    .note-title-input {
        font-size: 1.5rem;
        padding: 0.5rem 0;
    }
    
    .editor-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .editor-actions .btn {
        width: 100%;
    }
    
    .custom-folders-panel {
        width: 100%;
        border-radius: 12px 12px 0 0;
        bottom: 0;
        top: auto;
        max-height: 80vh;
    }
    
    .folders-list {
        max-height: 180px;
    }
    
    .note-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .note-tags {
        flex-wrap: wrap;
    }
    
    .floating-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .context-menu {
        width: 90%;
        max-width: 300px;
        left: 50% !important;
        transform: translateX(-50%);
    }
    
    .context-submenu {
        position: fixed;
        left: 5% !important;
        width: 90%;
        max-width: 300px;
        transform: translateX(0);
    }
    
    .folder-name {
        max-width: 120px;
    }
    
    .tooltip {
        display: none;
    }
}

/* Petits mobiles */
@media (max-width: 480px) {
    .sidebar {
        max-height: 50vh;
    }
    
    .main-content {
        height: 50vh;
    }
    
    .note-view h1 {
        font-size: 1.5rem;
    }
    
    .note-title-input {
        font-size: 1.3rem;
    }
    
    .folders-list {
        max-height: 150px;
    }
    
    .folder-item {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .note-item {
        padding: 0.8rem;
    }
    
    .note-title {
        font-size: 1rem;
    }
    
    .note-content {
        font-size: 0.9rem;
    }
    
    .tag {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .confirm-modal {
        width: 95%;
        min-width: auto;
    }
}

/* Ajustements pour le mode tactile */
@media (hover: none) {
    .note-item:hover,
    .folder-item:hover,
    .btn:hover {
        transform: none;
    }
    
    .note-item:active,
    .folder-item:active,
    .btn:active {
        transform: scale(0.98);
    }
    
    .floating-button:active {
        transform: scale(0.95);
    }
}

/* Ajustements pour l'orientation paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .app-container {
        flex-direction: row;
    }
    
    .sidebar {
        width: 40%;
        height: 100vh;
        max-height: none;
    }
    
    .main-content {
        width: 60%;
        height: 100vh;
    }
    
    .folders-list {
        max-height: calc(100vh - 200px);
    }
    
    .note-view,
    .editor-container {
        height: calc(100vh - 2rem);
        margin: 1rem;
        overflow-y: auto;
    }
}

/* Ajustements pour l'impression */
@media print {
    .sidebar,
    .floating-buttons,
    .editor-actions,
    .note-header-actions {
        display: none !important;
    }
    
    .app-container {
        display: block;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .note-view {
        box-shadow: none;
        margin: 0;
        padding: 2cm;
        max-width: none;
    }
    
    .note-view h1 {
        font-size: 24pt;
    }
    
    .note-content {
        font-size: 12pt;
        line-height: 1.5;
    }
}

/* Styles pour les boutons d'action de la note */
.note-header-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.note-header-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.note-header-actions .btn i {
    font-size: 1rem;
}

.note-header-actions .edit-note-btn {
    background: var(--primary-color);
    color: white;
}

.note-header-actions .edit-note-btn:hover {
    background: var(--primary-color-dark);
}

.note-header-actions .export-pdf-btn {
    background: var(--note-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.note-header-actions .export-pdf-btn:hover {
    background: var(--hover-color);
    border-color: var(--primary-color);
}

/* Styles pour les noms de dossiers et tooltips */
.folder-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    max-width: 160px;
}

/* Style du tooltip */
.tooltip {
    position: fixed;
    background: var(--note-bg);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    border: 1px solid var(--border-color);
    max-width: 300px;
    word-wrap: break-word;
}

/* Mode sombre pour le tooltip */
[data-theme="dark"] .tooltip {
    background: var(--note-bg);
    border-color: var(--border-color);
} 