/* Advance Visual Rotate PDF UI */

.hidden { display: none !important; }

.rp-workspace {
    max-width: 1100px !important;
    padding: 0 !important;
    overflow: hidden;
}

.rp-input-section {
    padding: 40px;
}

/* Editor Screen */
.rp-editor-screen {
    background: var(--bg-card);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
}

.rp-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.rp-header-title h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 5px;
}

.rp-header-title p {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.rp-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rp-btn-sm {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.rp-btn-danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}
.rp-btn-danger:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* Advanced Grid System */
.rp-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    max-height: 65vh;
    overflow-y: auto;
    padding: 30px;
    background: #f8fafc;
}
[data-theme="dark"] .rp-pages-grid { background: #0f172a; }

/* Custom Scrollbar */
.rp-pages-grid::-webkit-scrollbar { width: 8px; }
.rp-pages-grid::-webkit-scrollbar-track { background: var(--bg-input); }
.rp-pages-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* Premium Page Card */
.rp-page-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: 0.3s;
}
[data-theme="dark"] .rp-page-card { background: var(--bg-card); }

.rp-page-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.15);
    transform: translateY(-5px);
}

/* Canvas Wrapper for HD Rendering */
.rp-canvas-wrapper {
    background: #e2e8f0;
    aspect-ratio: 1 / 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    position: relative;
    overflow: hidden;
}
[data-theme="dark"] .rp-canvas-wrapper { background: #1e293b; }

.rp-canvas-element {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
}

.rp-page-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 5;
    backdrop-filter: blur(4px);
}

/* Advanced Card Controls */
.rp-card-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.rp-card-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rp-card-btn:hover {
    background: var(--primary);
    color: #fff;
}

.rp-card-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* Bottom Bar */
.rp-bottom-bar {
    display: flex;
    justify-content: center;
    padding: 20px 30px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.rp-btn-success {
    background: var(--success) !important;
    padding: 12px 30px;
    font-size: 1.05rem;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25) !important;
}

/* Processing Overlay */
.rp-processing-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
}

[data-theme="dark"] .rp-processing-overlay { background: rgba(15, 23, 42, 0.9); }

.rp-loader {
    width: 60px; height: 60px;
    border: 5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.rp-processing-overlay p {
    font-weight: 700; color: var(--primary); font-size: 1.2rem;
}

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

/* Result Screen */
.rp-result-screen { padding: 40px; text-align: center; }
.rp-success-box { max-width: 500px; margin: 0 auto; }
.rp-success-icon { font-size: 4rem; color: var(--success); margin-bottom: 20px; }
.rp-result-screen h3 { font-size: 1.5rem; font-weight: 800; color: var(--text-main); margin-bottom: 10px; }
.rp-result-screen p { color: var(--text-muted); margin-bottom: 30px; }
.rp-result-actions { display: flex; flex-direction: column; gap: 15px; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .rp-editor-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .rp-header-actions { width: 100%; justify-content: space-between; }
    .rp-pages-grid { grid-template-columns: repeat(2, 1fr); padding: 15px; gap: 15px; }
    .rp-canvas-wrapper { padding: 10px; }
    .rp-bottom-bar { flex-direction: column; gap: 15px; }
    #startOverBtn { margin-left: 0 !important; }
}
