/* Rotate PDF Specific Styles */
#rotation-area {
    width: 100%;
    margin-bottom: 100px;
    /* Space for the fixed bottom bar */
}

.global-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    margin-bottom: 2rem;
}

.global-actions p {
    color: var(--text-color-light);
    margin: 0;
}

.global-actions div {
    display: flex;
    gap: 1rem;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.page-preview-item {
    position: relative;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-preview-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.page-preview-item canvas {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background-color: #fff;
    transition: transform 0.3s ease;
}

.page-number {
    font-size: 0.85rem;
    color: var(--text-color-light);
    font-weight: 500;
}

.rotate-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.page-preview-item:hover .rotate-overlay {
    opacity: 1;
}

.rotate-overlay i {
    font-size: 3rem;
    color: #fff;
}

.fixed-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(13, 13, 26, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    z-index: 100;
    border-top: 1px solid var(--card-border);
}

/* Reusable styles from previous tools */
.download-area {
    padding: 2.5rem;
    background: rgba(46, 204, 113, 0.05);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 12px;
    text-align: center;
    max-width: 600px;
    margin: 2rem auto 0;
    animation: fadeIn 0.5s ease;
}

.download-area h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    color: #2ecc71;
    margin-bottom: 0.5rem;
}

.download-area p {
    color: var(--text-color-light);
    margin-bottom: 2rem;
}

.download-area .btn-link {
    background: none;
    border: none;
    color: var(--text-color-light);
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.download-area .btn-link:hover {
    color: var(--primary-color);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(13, 13, 26, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.loading-overlay p {
    color: var(--text-color-light);
    margin-top: 1.5rem;
}

.spinner {
    border: 4px solid var(--card-border);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* For page loader (reused from Organize PDF) */
.page-loader {
    width: 100%;
    aspect-ratio: 1 / 1.414;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.mini-spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 0.8s linear infinite;
}