/* PDF Editor Styles */

.pdf-editor-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

/* PDF Tabs Slide Menu */
.pdf-tabs-slide {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px 10px 0 0;
    padding: 10px 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.pdf-tabs {
    display: flex;
    gap: 10px;
    min-width: min-content;
}

.pdf-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.pdf-tab:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
}

.pdf-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pdf-tab-icon {
    font-size: 20px;
}

.pdf-tab-name {
    font-weight: 600;
}

.pdf-tab-pages {
    font-size: 0.85em;
    opacity: 0.7;
}

.pdf-tab-close {
    margin-left: 10px;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
    border-radius: 4px;
}

.pdf-tab-close:hover {
    background: rgba(0,0,0,0.1);
}

/* Editor Main */
.editor-main {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 30px;
    margin: 0 auto;
    max-width: 1400px;
}

.editor-header {
    text-align: center;
    margin-bottom: 30px;
}

.editor-header h1 {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1em;
}

/* Upload Section */
.upload-section {
    margin: 40px 0;
}

.drop-zone {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #764ba2;
    transform: scale(1.02);
}

.drop-zone-content {
    cursor: pointer;
}

.drop-icon {
    font-size: 4em;
    display: block;
    margin-bottom: 20px;
}

.hint {
    color: #999;
    font-size: 0.9em;
    margin-top: 10px;
}

.file-input-hidden {
    display: none;
}

/* Quick Upload Bar */
.quick-upload-bar {
    margin: 20px 0;
    text-align: center;
}

/* Toolbar */
.editor-toolbar {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tool-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.tool-group h3 {
    margin: 0 0 5px 0;
    font-size: 0.9em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.btn-tool {
    padding: 10px 15px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-tool:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

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

/* Pages Container */
.pages-container {
    margin-top: 30px;
}

.pages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--text-primary);
}

.selection-actions {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.9em;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
}

.btn-sm:hover {
    background: var(--text-primary);
}

/* Pages Grid */
.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.page-item {
    position: relative;
    background: white;
    border: 3px solid var(--text-primary);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.page-item:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.page-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.page-item.split-marker {
    border-color: #ff6b6b;
    border-style: dashed;
}

.selection-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
}

.split-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: #ff6b6b;
    color: white;
    padding: 5px;
    border-radius: 5px;
    font-size: 0.75em;
    text-align: center;
    z-index: 10;
}

.page-preview {
    width: 100%;
    height: 250px;
    background: #f5f5f5;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
}

.page-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbnail-placeholder {
    font-size: 4em;
    color: #ccc;
}

.page-info {
    text-align: center;
    margin-bottom: 10px;
}

.page-number {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.page-size {
    display: block;
    font-size: 0.85em;
    color: var(--text-muted);
}

.rotation-badge {
    display: inline-block;
    background: var(--warning-color);
    color: #333;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    margin-top: 5px;
}

.page-actions {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.btn-icon {
    background: #f0f0f0;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-dialog {
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid var(--text-primary);
}

.modal-header h2 {
    margin: 0;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.btn-close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.split-info {
    background: #f0f7ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    margin-top: 10px;
}

.split-preview {
    margin-top: 20px;
}

.split-preview h3 {
    margin-bottom: 15px;
}

.split-part {
    background: #f8f9fa;
    border: 2px solid var(--text-primary);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.split-part-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.split-part-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.split-part-input label {
    font-weight: 600;
    min-width: 80px;
}

.form-control {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid var(--text-primary);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

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