/* Navigation */
.app-navigation {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    padding: 12px 30px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: white;
    color: #667eea;
}

.nav-btn span {
    font-size: 20px;
}

/* App Sections */
.app-section {
    display: none;
}

.app-section.active {
    display: block;
}

/* PPTX Editor Wrapper */
.pptx-editor-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 200px);
}

/* PPTX Header */
.pptx-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pptx-header h1 {
    margin: 0;
    color: #333;
    font-size: 28px;
}

.pptx-actions {
    display: flex;
    gap: 10px;
}

.pptx-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-pptx-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.download-pptx-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Upload Area */
.pptx-upload-area {
    background: white;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    border: 3px dashed #ddd;
    transition: all 0.3s ease;
}

.pptx-upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-content {
    max-width: 500px;
    margin: 0 auto;
}

.upload-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.upload-content h2 {
    color: #333;
    margin-bottom: 10px;
}

.upload-content p {
    color: #666;
    margin-bottom: 30px;
}

.upload-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Loading Indicator */
.pptx-loading {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pptx-loading p {
    color: #666;
    font-size: 16px;
}

/* Editor Area */
.pptx-editor-area {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 600px;
}

/* Thumbnails Panel */
.pptx-thumbnails-panel {
    border-right: 2px solid #eee;
    padding-right: 20px;
}

.pptx-thumbnails-panel h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.thumbnails-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 700px;
    overflow-y: auto;
}

.thumbnail-item {
    position: relative;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.thumbnail-item:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.thumbnail-item.active {
    border-color: #667eea;
    background: #f8f9ff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.thumbnail-item canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.thumbnail-number {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Workspace */
.pptx-workspace {
    display: flex;
    flex-direction: column;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.workspace-header span {
    font-weight: 600;
    color: #666;
}

.workspace-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Canvas Container */
.canvas-container {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    min-height: 500px;
}

#pptxCanvas {
    max-width: 100%;
    max-height: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: white;
    cursor: pointer;
}

/* Text Edit Overlay */
.text-edit-overlay {
    position: absolute;
    z-index: 100;
}

.text-edit-overlay textarea {
    width: 100%;
    height: 100%;
    border: 2px solid #667eea;
    border-radius: 4px;
    padding: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.text-edit-overlay textarea:focus {
    outline: none;
    border-color: #764ba2;
}

/* Error Message */
.pptx-error-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.error-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.error-icon {
    font-size: 60px;
    display: block;
    margin-bottom: 20px;
}

.error-content h3 {
    color: #d32f2f;
    margin: 0 0 15px 0;
}

.error-content p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.error-btn {
    padding: 12px 32px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-btn:hover {
    background: #b71c1c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pptx-editor-area {
        grid-template-columns: 1fr;
    }
    
    .pptx-thumbnails-panel {
        border-right: none;
        border-bottom: 2px solid #eee;
        padding-right: 0;
        padding-bottom: 20px;
    }
    
    .thumbnails-list {
        flex-direction: row;
        overflow-x: auto;
        max-height: none;
    }
    
    .thumbnail-item {
        min-width: 150px;
    }
}
