/*//////////////////////////////////////////////////////////
//  Focus mode setup
///////////////////////////////////////////////////////////*/

.app-container.focus-mode {
    display: flex !important;
    flex-direction: column !important;
}

.app-container.focus-mode .app-content {
    display: flex !important;
    flex: 1 !important;
    overflow: hidden !important;
}

.app-container.focus-mode .sidebar {
    display: none !important;
    width: 0 !important;
}

.app-container.focus-mode .app-header {
    display: none !important;
}

.app-container.focus-mode .editor-container {
    background: var(--bg-primary);
    height: 100vh !important;
    width: 100% !important;
    flex: 1 !important;
}

/* Header de l'éditeur toujours visible en mode focus */
.app-container.focus-mode .editor-header {
    opacity: 1;
}

/* Toolbar toujours visible en mode focus (garde son style normal) */
.app-container.focus-mode .editor-toolbar {
    opacity: 1;
}

/*//////////////////////////////////////////////////////////
//  Progress Bar
///////////////////////////////////////////////////////////*/

/*//////////////////////////////////////////////////////////
//  Progress Bar - Floating Glassmorphism HUD
///////////////////////////////////////////////////////////*/

.writing-progress-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 600px;
    max-width: 90vw;
    height: 48px;
    background: rgba(var(--bg-accent-rgb), 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    z-index: 9999;
    display: none;
    flex-direction: row;
    /* Horizontal layout */
    align-items: center;
    border-radius: var(--radius-full);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    overflow: hidden;
    padding: 0 4px;
}

.app-container.focus-mode .writing-progress-bar {
    display: flex;
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Container de la barre de jauge */
.progress-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    margin: 0 16px;
    overflow: hidden;
    position: relative;
}

.writing-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-red));
    border-radius: var(--radius-full);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    box-shadow: 0 0 12px rgba(var(--accent-gold-rgb), 0.4);
}

.writing-progress-text {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    font-weight: 600;
    padding: 0 16px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Séparateur vertical discret */
.writing-progress-text+.writing-progress-text {
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

/*//////////////////////////////////////////////////////////
//  Focus mode panel
///////////////////////////////////////////////////////////*/

.focus-mode-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 2px solid var(--accent-gold);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.focus-mode-panel.active {
    transform: translateX(0);
}

.app-container.focus-mode .focus-mode-panel {
    display: flex;
}

.focus-panel-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-accent);
    color: var(--bg-primary);
}

.focus-panel-title {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Noto Serif JP', serif;
}

.focus-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.focus-section {
    margin-bottom: 2rem;
}

.focus-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pomodoro-timer {
    text-align: center;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 4px;
    border: 2px solid var(--border-color);
}

.pomodoro-display {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Source Code Pro', monospace;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.pomodoro-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.ambient-music {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.focus-toggle-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2001;
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
    font-family: 'Crimson Pro', serif;
}

.app-container.focus-mode .focus-toggle-btn {
    display: block !important;
}

.focus-toggle-btn:hover {
    background: var(--accent-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.focus-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.focus-stat-box {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    text-align: center;
}

.focus-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    font-family: 'Source Code Pro', monospace;
}

.focus-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Pomodoro Popup in header */
.pomodoro-popup {
    position: fixed;
    top: 60px;
    right: 100px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
    min-width: 200px;
}

.pomodoro-popup.active {
    display: block;
}

.pomodoro-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

.pomodoro-popup-close {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.pomodoro-popup-close:hover {
    color: var(--accent-red);
}

.pomodoro-popup-content {
    padding: 1.5rem;
    text-align: center;
}

.pomodoro-popup .pomodoro-display {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.pomodoro-popup .pomodoro-controls {
    margin-bottom: 1rem;
}

.pomodoro-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.pomodoro-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pomodoro-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.pomodoro-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Visual indicator when timer is running */
.header-action-btn.pomodoro-active {
    color: var(--accent-red);
    animation: pomodoro-pulse 1s ease-in-out infinite;
}

@keyframes pomodoro-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}


/*//////////////////////////////////////////////////////////
//  Focus mode - Adaptations for productivity tools
///////////////////////////////////////////////////////////*/

/* Ensure structure blocks stay visible for active use */
.app-container.focus-mode .structure-block {
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.app-container.focus-mode .structure-block:hover {
    opacity: 1;
}

/* Modals should be above everything even in focus mode */
.app-container.focus-mode .modal {
    z-index: 10000000 !important;
}

.focus-settings-btn {
    background: var(--accent-gold) !important;
    color: var(--bg-accent) !important;
    border-color: var(--accent-gold) !important;
}

.focus-settings-btn:hover {
    background: var(--accent-red) !important;
    border-color: var(--accent-red) !important;
    color: white !important;
}