/* ========================================
   FLYING BOOK - PRESENTATION STYLES
   ======================================== */

:root {
    --theme-primary: #667eea;
    --theme-secondary: #764ba2;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --text-white: #ffffff;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #374151;
    --bg-overlay: rgba(0, 0, 0, 0.8);
    
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --transition-speed: 500ms;
    --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
    
    --header-height: 80px;
    --thumbnails-height: 120px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-white);
    line-height: 1.6;
    overflow: hidden;
    user-select: none;
}

/* ========================================
   LOADING SCREEN
   ======================================== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    font-size: 4rem;
    margin-bottom: 2rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.loading-progress {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* ========================================
   PRESENTATION HEADER
   ======================================== */

.presentation-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.presentation-header.hidden {
    transform: translateY(-100%);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 2rem;
}

.presentation-info {
    flex: 1;
}

.presentation-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.25rem;
}

.presentation-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.presentation-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    text-decoration: none;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.presentation-progress {
    height: 20px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1.5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
    transition: width 0.3s ease;
    border-radius: 1.5px;
}

.slide-counter {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    min-width: 60px;
    text-align: right;
}

/* ========================================
   PRESENTATION CONTAINER
   ======================================== */

.presentation-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.slides-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--transition-speed) var(--transition-easing);
}

.slide.active {
    opacity: 1;
    transform: translateX(0);
}

.slide.prev {
    transform: translateX(-100%);
}

.slide.next {
    transform: translateX(100%);
}

/* Transitions spécifiques */
body[data-transition="fade"] .slide {
    transform: none;
}

body[data-transition="fade"] .slide.active {
    opacity: 1;
}

body[data-transition="flip"] .slide {
    transform: perspective(1000px) rotateY(90deg);
}

body[data-transition="flip"] .slide.active {
    transform: perspective(1000px) rotateY(0deg);
}

body[data-transition="3d"] .slide {
    transform: perspective(1000px) rotateX(45deg) translateZ(-200px);
}

body[data-transition="3d"] .slide.active {
    transform: perspective(1000px) rotateX(0deg) translateZ(0);
}

body[data-transition="premium_3d"] .slide {
    transform: perspective(1200px) rotateY(45deg) rotateX(25deg) translateZ(-300px);
    filter: blur(2px);
}

body[data-transition="premium_3d"] .slide.active {
    transform: perspective(1200px) rotateY(0deg) rotateX(0deg) translateZ(0);
    filter: blur(0);
}

.slide-content {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

/* ========================================
   SLIDE MEDIA
   ======================================== */

.slide-media {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-image,
.slide-video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

.slide-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-audio {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 400px;
}

.slide-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.slide-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* ========================================
   SLIDE TEXT OVERLAY
   ======================================== */

.slide-text-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 3rem 2rem 2rem;
    color: white;
    backdrop-filter: blur(5px);
}

.text-content {
    font-size: 1.125rem;
    line-height: 1.6;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.slide-title {
    position: absolute;
    top: 2rem;
    left: 2rem;
    right: 2rem;
    text-align: center;
}

.slide-title h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

/* ========================================
   AUTO PROGRESS INDICATOR
   ======================================== */

.auto-progress-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
}

.auto-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
    width: 0%;
    transition: width linear;
}

/* ========================================
   NAVIGATION
   ======================================== */

.slide-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    pointer-events: none;
    z-index: 100;
}

.nav-btn {
    width: 60px;
    height: 60px;
    background: var(--bg-overlay);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   THUMBNAILS
   ======================================== */

.slide-thumbnails {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--thumbnails-height);
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.slide-thumbnails.hidden {
    transform: translateY(100%);
}

.thumbnails-container {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 1rem 2rem;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
}

.thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    position: relative;
}

.thumbnail:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.thumbnail.active {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 2px var(--theme-primary);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.25rem;
}

/* ========================================
   SETTINGS PANEL
   ======================================== */

.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 2000;
    color: var(--text-primary);
}

.settings-panel.open {
    transform: translateX(0);
}

.settings-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.close-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.settings-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.setting-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--theme-primary);
}

.setting-group input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
    accent-color: var(--theme-primary);
}

.range-value {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.setting-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    margin-top: 0.5rem;
}

.settings-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
}

/* ========================================
   MODALS
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 3000;
    padding: 1rem;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    color: var(--text-primary);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.modal-body {
    padding: 1.5rem;
}

/* ========================================
   SHARE MODAL
   ======================================== */

.share-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.share-option label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--bg-secondary);
}

.share-social h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.social-btn.facebook {
    background: #1877f2;
    color: white;
}

.social-btn.twitter {
    background: #1da1f2;
    color: white;
}

.social-btn.linkedin {
    background: #0077b5;
    color: white;
}

.social-btn.email {
    background: var(--text-secondary);
    color: white;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 40px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .slide-content {
        width: 95%;
        height: 85%;
    }
    
    .settings-panel {
        width: 300px;
    }
    
    .nav-btn {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        --thumbnails-height: 100px;
    }
    
    .header-content {
        padding: 0 1rem;
        height: 50px;
    }
    
    .presentation-title {
        font-size: 1.25rem;
    }
    
    .presentation-subtitle {
        font-size: 0.875rem;
    }
    
    .presentation-progress {
        padding: 0 1rem;
        height: 10px;
    }
    
    .slide-content {
        width: 98%;
        height: 80%;
    }
    
    .slide-title h2 {
        font-size: 1.5rem;
        padding: 0.75rem 1rem;
    }
    
    .text-content {
        font-size: 1rem;
    }
    
    .nav-btn {
        width: 45px;
        height: 45px;
        font-size: 0.875rem;
    }
    
    .slide-navigation {
        padding: 0 1rem;
    }
    
    .thumbnails-container {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .thumbnail {
        width: 100px;
        height: 60px;
    }
    
    .settings-panel {
        width: 100%;
    }
    
    .modal {
        padding: 0.5rem;
    }
    
    .social-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .slide-content {
        border-radius: var(--radius-md);
    }
    
    .slide-title h2 {
        font-size: 1.25rem;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .thumbnail {
        width: 80px;
        height: 50px;
    }
}

/* ========================================
   FULLSCREEN MODE
   ======================================== */

body.fullscreen .presentation-header,
body.fullscreen .slide-thumbnails {
    transform: translateY(-100%);
}

body.fullscreen .slide-thumbnails {
    transform: translateY(100%);
}

body.fullscreen .presentation-container {
    height: 100vh;
}

/* ========================================
   KEYBOARD NAVIGATION HINTS
   ======================================== */

.keyboard-hint {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: var(--bg-overlay);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.keyboard-hint:hover {
    opacity: 1;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    body {
        background: white;
        color: black;
    }
    
    .presentation-header,
    .slide-navigation,
    .slide-thumbnails,
    .settings-panel,
    .modal {
        display: none !important;
    }
    
    .presentation-container {
        position: relative;
        height: auto;
    }
    
    .slide {
        position: relative;
        opacity: 1 !important;
        transform: none !important;
        page-break-after: always;
        width: 100%;
        height: 100vh;
    }
    
    .slide-content {
        background: white;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideInFromRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInFromLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeInUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.slide-in-right {
    animation: slideInFromRight 0.5s ease-out;
}

.slide-in-left {
    animation: slideInFromLeft 0.5s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}