/**
 * Advanced PDF Page Editor Styles
 * Professional styling for comprehensive PDF page management
 */

/* Main Layout */
.page-operations-panel {
    height: calc(100vh - 200px);
    overflow-y: auto;
    position: sticky;
    top: 20px;
}

.pdf-page-editor-container {
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

/* Category Titles */
.category-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tool Groups */
.tool-group {
    margin-bottom: 1rem;
}

.tool-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Upload Area */
.upload-area-small {
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area-small:hover,
.upload-area-small.drag-over {
    border-color: #3b82f6;
    background: #dbeafe;
}

.upload-area-small p {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

/* Page Information */
.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.info-item small {
    font-size: 0.8rem;
}

.info-item .badge {
    font-size: 0.75rem;
}

/* Action Buttons */
.action-buttons .btn {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.action-buttons .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Editor Toolbar */
.editor-toolbar {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.file-controls {
    font-size: 0.9rem;
    color: #6b7280;
}

.view-controls .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.view-controls .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Page Thumbnails Area */
.page-thumbnails-area {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.page-thumbnails-container {
    height: 100%;
    overflow: auto;
    padding: 1rem;
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
}

.upload-prompt h4 {
    color: #374151;
    margin-bottom: 0.5rem;
}

.upload-prompt p {
    margin-bottom: 1.5rem;
}

/* Page Thumbnails */
.page-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.page-thumbnail {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.page-thumbnail:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.page-thumbnail.selected {
    border-color: #3b82f6;
    background: #dbeafe;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.page-thumbnail.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Thumbnail Header */
.thumbnail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.page-number {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    background: #e5e7eb;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.thumbnail-actions {
    display: flex;
    gap: 0.25rem;
}

.thumbnail-actions .btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.4rem;
    border-radius: 0.25rem;
}

/* Thumbnail Content */
.thumbnail-content {
    padding: 0.5rem;
    text-align: center;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-image {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Thumbnail Footer */
.thumbnail-footer {
    padding: 0.5rem;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.thumbnail-footer small {
    font-size: 0.7rem;
    color: #6b7280;
}

/* Status Bar */
.status-bar {
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    font-size: 0.8rem;
    color: #6b7280;
}

/* Crop Modal */
.crop-canvas-container {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f9fafb;
}

.crop-canvas {
    width: 100%;
    height: 400px;
    background: #fff;
    cursor: crosshair;
}

.crop-controls {
    padding: 1rem;
}

.crop-controls h6 {
    color: #374151;
    margin-bottom: 1rem;
    font-weight: 600;
}

.crop-controls .form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.crop-controls .form-control {
    font-size: 0.85rem;
    border-radius: 0.375rem;
}

.crop-controls .form-select {
    font-size: 0.85rem;
    border-radius: 0.375rem;
}

/* Preview Modal */
.preview-container {
    text-align: center;
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.preview-canvas {
    max-width: 100%;
    max-height: 70vh;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.preview-controls .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

/* Benefits Section */
.benefits-section {
    margin-top: 3rem;
}

.section-title {
    color: #1f2937;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

.benefit-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.benefit-icon {
    color: #3b82f6;
    margin-bottom: 1rem;
}

.benefit-card h3 {
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.benefit-card p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Advanced Features Section */
.advanced-features-section {
    margin-top: 3rem;
}

.feature-list {
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-list:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.12);
}

.feature-list h4 {
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-list h4 i {
    margin-right: 0.5rem;
}

.feature-list-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list-items li {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    color: #4b5563;
    font-size: 0.9rem;
    border-bottom: 1px solid #f3f4f6;
}

.feature-list-items li:last-child {
    border-bottom: none;
}

.feature-list-items li i {
    color: #3b82f6;
    margin-right: 0.75rem;
    width: 16px;
    text-align: center;
}

/* FAQ Section */
.faq-section {
    margin-top: 3rem;
}

.accordion-item {
    border: none;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.accordion-button {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    border: none;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.accordion-button:not(.collapsed) {
    background: #dbeafe;
    color: #1e40af;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border: none;
}

.accordion-body {
    background: #fff;
    padding: 1.5rem;
    color: #6b7280;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .page-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 992px) {
    .page-operations-panel {
        height: auto;
        position: static;
        margin-bottom: 1rem;
    }
    
    .pdf-page-editor-container {
        height: auto;
        min-height: 500px;
    }
    
    .page-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }
    
    .page-thumbnails-container {
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .page-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.5rem;
    }
    
    .thumbnail-content {
        min-height: 120px;
    }
    
    .thumbnail-image {
        max-height: 110px;
    }
    
    .editor-toolbar .row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .view-controls {
        text-align: left;
    }
    
    .crop-canvas {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .page-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .thumbnail-content {
        min-height: 100px;
    }
    
    .thumbnail-image {
        max-height: 90px;
    }
    
    .page-number {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .thumbnail-actions .btn {
        font-size: 0.6rem;
        padding: 0.2rem 0.3rem;
    }
    
    .crop-canvas {
        height: 250px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

.scale-in {
    animation: scaleIn 0.2s ease-out;
}

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

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Drag and Drop States */
.drag-over {
    border-color: #3b82f6 !important;
    background: #dbeafe !important;
    transform: scale(1.02);
}

.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.drop-zone {
    border: 2px dashed #3b82f6;
    background: #dbeafe;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

/* Selection States */
.selected {
    border-color: #3b82f6 !important;
    background: #dbeafe !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2) !important;
}

.multi-select {
    border-color: #10b981 !important;
    background: #d1fae5 !important;
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zoom-slider {
    width: 100px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
}

.zoom-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Fullscreen Mode */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #fff;
    padding: 1rem;
}

.fullscreen .page-thumbnails-container {
    height: calc(100vh - 100px);
}

/* Print Styles */
@media print {
    .page-operations-panel,
    .editor-toolbar,
    .status-bar,
    .action-buttons {
        display: none !important;
    }
    
    .pdf-page-editor-container {
        height: auto !important;
    }
    
    .page-thumbnails {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem !important;
    }
} 