/* Modern Editor Layout - No Book Aspect */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    overflow-x: hidden;
}

/* Editor Container - Full Screen */
.editor-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

/* Editor Header */
.editor-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: white;
    color: #667eea;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Main Editor Area */
.editor-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    flex-shrink: 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}

.sidebar-section {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.page-navigation {
    list-style: none;
}

.page-nav-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.page-nav-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.page-nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.page-nav-item i {
    width: 20px;
    text-align: center;
}

/* Canvas - Main Content Area */
.canvas-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.canvas-container {
    flex: 1;
    overflow-y: auto;
    background: white;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.02);
}

#canvas {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 80px;
    min-height: 100%;
    background: white;
}

/* Editable Content Styles */
.editable {
    outline: none;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 8px;
    margin: -8px;
}

.editable:hover {
    background: rgba(102, 126, 234, 0.05);
}

.editable:focus {
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.editable.selected {
    background: rgba(102, 126, 234, 0.15);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.5);
}

/* Cover Section */
.book-cover {
    text-align: center;
    padding: 60px 0;
    border-bottom: 3px solid #667eea;
    margin-bottom: 60px;
}

.book-title {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.book-subtitle {
    font-size: 1.5rem;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-style: italic;
}

.memorial-name {
    font-size: 2rem;
    color: #2c3e50;
    margin: 20px 0;
    font-style: italic;
}

.created-for {
    font-size: 1.3rem;
    color: #7f8c8d;
    margin-top: 15px;
}

.book-decoration {
    font-size: 3rem;
    color: #667eea;
    margin-top: 30px;
    opacity: 0.5;
}

/* Page Sections */
.book-page {
    padding: 40px 0;
    margin-bottom: 50px;
}

.book-page.hidden {
    display: none;
}

.page-title {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
}

.dedication-text,
.summary-text {
    font-size: 1.2rem;
    line-height: 2;
    text-align: justify;
    color: #34495e;
    font-family: Georgia, serif;
}

/* Chapter Section */
.chapter-page {
    padding: 50px 0;
    margin-bottom: 40px;
}

.chapter-title {
    font-size: 2.2rem;
    color: #667eea;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
}

.chapter-content {
    font-size: 1.1rem;
    line-height: 1.9;
    text-align: justify;
    color: #2c3e50;
    font-family: Georgia, serif;
}

/* Properties Panel */
.properties-panel {
    width: 320px;
    background: white;
    border-left: 1px solid #e0e0e0;
    overflow-y: auto;
    flex-shrink: 0;
    box-shadow: -2px 0 8px rgba(0,0,0,0.05);
}

.properties-section {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.properties-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #34495e;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider {
    flex: 1;
}

.slider-value {
    min-width: 45px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
}

/* Button Groups */
.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Formatting Toolbar */
.formatting-toolbar {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.toolbar-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Image Upload */
.image-upload-area {
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.image-upload-area i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.notification.success {
    background: #10b981;
    color: white;
}

.notification.error {
    background: #ef4444;
    color: white;
}

.notification.info {
    background: #667eea;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1400px) {
    .properties-panel {
        width: 280px;
    }
}

@media (max-width: 1200px) {
    .sidebar {
        width: 240px;
    }
    
    #canvas {
        padding: 40px 50px;
    }
}

@media (max-width: 1024px) {
    .properties-panel {
        position: fixed;
        right: -320px;
        top: 64px;
        height: calc(100vh - 64px);
        z-index: 90;
        transition: right 0.3s ease;
    }
    
    .properties-panel.open {
        right: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 64px;
        height: calc(100vh - 64px);
        z-index: 90;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    #canvas {
        padding: 30px 30px;
    }
    
    .book-title {
        font-size: 2.2rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
}

/* Loading Indicator */
.save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: rgba(102, 126, 234, 0.3);
}
