/* PDF Rotator - Professional Modern Design */
:root {
    --primary-color: #274c77;
    --primary-light: #3a6ca5;
    --primary-dark: #1a3655;
    --secondary-color: #6096ba;
    --secondary-light: #8ab3d4;
    --secondary-dark: #4a7a9a;
    --accent-color: #a3cef1;
    --light-bg: #f8fafc;
    --dark-bg: #1a1a2e;
    --text-dark: #2d3748;
    --text-light: #718096;
    --text-white: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #38a169;
    --warning-color: #d69e2e;
    --error-color: #e53e3e;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}
    
    body {
        
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        color: var(--text-dark);
    }
    
    .upload-section,
    .preview-section,
    .features-section,
    .seo-content-section,
    .guide-sidebar,
    .loading-content {
        background: #2d3748;
        border-color: var(--border-color);
    }
    
    .upload-area {
        background: #2d3748;
        border-color: var(--border-color);
    }
    
    .upload-area.drag-over {
        background: rgba(58, 108, 165, 0.15);
        border-color: var(--primary-color);
    }
    
    .canvas-container,
    .controls-panel,
    .thumbnails-grid {
        background: #1a202c;
    }
    
    #mainCanvas {
        background: #2d3748;
        border: 1px solid var(--border-color);
    }
    
    .thumbnail-card {
        background: #2d3748;
        border-color: var(--border-color);
    }
    
    .thumbnail-card.active {
        background: rgba(58, 108, 165, 0.2);
        border-color: var(--primary-color);
    }
    
    .thumbnail-card.modified {
        background: rgba(122, 168, 204, 0.15);
        border-color: var(--secondary-color);
    }
    
    .thumbnail-canvas {
        background: #1a202c;
    }
    
    .file-meta,
    .keyboard-hint,
    .thumbnails-hint,
    .export-info,
    .page-info {
        background: #4a5568;
        color: var(--text-light);
        border-color: var(--border-color);
    }
    
    .zoom-btn,
    .btn-secondary {
        background: #2d3748;
        color: var(--text-dark);
        border-color: var(--border-color);
    }
    
    .zoom-btn:hover:not(:disabled),
    .btn-secondary:hover {
        background: var(--primary-color);
        color: var(--text-white);
        border-color: var(--primary-color);
    }
    
    .feature-card {
        background: #2d3748;
        border-color: var(--border-color);
    }
    
    .feature-card:hover {
        border-color: var(--primary-color);
        background: #374151;
    }
    
    .faq-item {
        background: #2d3748;
        border-left-color: var(--secondary-color);
    }
    
    .guide-tips {
        background: linear-gradient(135deg, rgba(163, 206, 241, 0.15), rgba(122, 168, 204, 0.15));
        border-left-color: var(--accent-color);
    }
    
    .guide-tips kbd {
        background: #1a202c;
        border-color: var(--border-color);
        color: var(--accent-color);
    }
    
    .loading-overlay {
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
    }
    
    .progress-bar {
        background: #2d3748;
    }
    
    .section-header h2,
    .preview-header h3,
    .panel-header h3,
    .thumbnails-header h3,
    .guide-header h3,
    .step-content h4,
    .seo-content h2,
    .seo-text-content h3,
    .seo-text-content h4 {
        color: var(--primary-dark);
    }
    
    .upload-text h3 {
        color: var(--text-white);
    }
    
    .upload-text p,
    .upload-hint {
        color: var(--text-light);
    }
    
    .faq-item p,
    .seo-text-content p,
    .seo-text-content li {
        color: var(--text-light);
    }
    
    .step-content p {
        color: var(--text-light);
    }
    
    .thumbnails-grid::-webkit-scrollbar-track {
        background: #2d3748;
    }
    
    .thumbnails-grid::-webkit-scrollbar-thumb {
        background: #4a5568;
    }
    
    .thumbnails-grid::-webkit-scrollbar-thumb:hover {
        background: #5a6578;
    }
    
    #zoomRange {
        background: linear-gradient(to right, #4a5568, var(--primary-color));
    }
    
    #zoomRange::-webkit-slider-thumb {
        background: var(--primary-color);
        border-color: #2d3748;
    }
    
    #zoomRange::-moz-range-thumb {
        background: var(--primary-color);
        border-color: #2d3748;
    }
    
    .zoom-value {
        background: #2d3748;
        color: var(--accent-color);
    }
    
    #newFileBtn {
        background: #2d3748;
        color: var(--accent-color);
        border-color: var(--primary-color);
    }
    
    #newFileBtn:hover {
        background: var(--primary-color);
        color: var(--text-white);
    }
    
    ::selection {
        background: rgba(58, 108, 165, 0.5);
        color: white;
    }
    
    :focus-visible {
        outline: 2px solid var(--accent-color);
        outline-offset: 2px;
    }
    
    ::placeholder {
        color: #718096;
    }
    
    .seo-text-content a {
        color: var(--accent-color);
    }
    
    .seo-text-content a:hover {
        border-bottom-color: var(--accent-color);
    }
}

/* ====== BASE STYLES ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    min-height: 100vh;
    padding-top: 70px;
}

.pdf-rotator-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ====== HEADER ====== */
.page-header {
    background: transparent;
    border-radius: var(--radius-xl);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
}

.page-header h1 i {
    color: var(--accent-color);
    font-size: 2.2rem;
}

.page-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    position: relative;
}

/* ====== TOOL CONTAINER ====== */
.tool-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* ====== UPLOAD SECTION ====== */
.upload-section {
    background: var(--text-white);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    border: 2px dashed var(--border-color);
    transition: all var(--transition-normal);
}

.upload-section:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.upload-section.hidden {
    display: none;
}

.section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

@media (min-width: 768px) {
    .section-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary-color);
}

.file-meta {
    background: var(--light-bg);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    color: var(--secondary-dark);
    border: 1px solid var(--border-color);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Upload Area Layout */
.hehe-tool {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 992px) {
    .hehe-tool {
        grid-template-columns: 1.5fr 1fr;
        gap: 40px;
        align-items: start;
    }
}

.upload-area-container {
    position: relative;
}

.upload-area {
    display: block;
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--light-bg);
    position: relative;
    overflow: hidden;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .upload-area {
        padding: 60px 40px;
        min-height: 300px;
    }
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(39, 76, 119, 0.05);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@media (min-width: 768px) {
    .upload-icon {
        font-size: 4rem;
        margin-bottom: 20px;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.upload-text h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-weight: 600;
}

@media (min-width: 768px) {
    .upload-text h3 {
        font-size: 1.5rem;
    }
}

.upload-text p {
    color: var(--text-light);
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.upload-hint {
    font-size: 0.85rem !important;
    color: var(--secondary-color) !important;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.upload-hint:before {
    content: "✓";
    color: var(--success-color);
    font-weight: bold;
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* Guide Content */
.guide-content {
    background: var(--light-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.guide-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.guide-step:last-child {
    margin-bottom: 0;
}

.step-number {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

.step-content h4 {
    font-size: 0.95rem;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

@media (min-width: 768px) {
    .step-content h4 {
        font-size: 1rem;
    }
}

.step-content p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

@media (min-width: 768px) {
    .step-content p {
        font-size: 0.9rem;
    }
}

/* ====== PREVIEW SECTION ====== */
.preview-section {
    background: var(--text-white);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
}

.preview-section.hidden {
    display: none;
}

.preview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

@media (min-width: 1024px) {
    .preview-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Main Preview */
.main-preview {
    background: var(--light-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

@media (min-width: 640px) {
    .preview-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
    }
}

.preview-header h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 20px;
}

/* Single Page Controls in Header */
.single-page-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

@media (min-width: 640px) {
    .single-page-controls {
        width: auto;
        min-width: 300px;
    }
}

.single-page-controls h4 {
    font-size: 1rem;
    color: var(--primary-dark);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.btn-group .btn-rotate {
    flex: 1;
    min-width: 120px;
    min-height: 44px;
}

.btn-rotate {
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
}

.btn-left {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-white);
}

.btn-right {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: var(--text-white);
}

.btn-rotate:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-rotate:active {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
    margin-top: 5px;
    min-height: 44px;
}

.canvas-container {
    position: relative;
    background: var(--text-white);
    border-radius: var(--radius-lg);
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    min-height: 300px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

#mainCanvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    background: var(--text-white);
}

.preview-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
}

@media (min-width: 640px) {
    .preview-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.page-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: var(--primary-dark);
    font-weight: 500;
    background: var(--light-bg);
    padding: 12px 15px;
    border-radius: var(--radius-lg);
    white-space: nowrap;
    flex-shrink: 0;
}

.preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

@media (min-width: 640px) {
    .preview-actions {
        width: auto;
        justify-content: flex-end;
    }
}

.preview-actions .btn-secondary {
    flex: 1;
    min-width: 140px;
    min-height: 20px;
}

@media (max-width: 480px) {
    .preview-actions {
        flex-direction: row;
    }
    
    .preview-actions .btn-secondary {
        min-width: 20px;
    }
}

/* ====== CONTROLS PANEL ====== */
.controls-panel {
    background: var(--light-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

@media (min-width: 640px) {
    .panel-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.panel-header h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.keyboard-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary-color);
    font-size: 0.85rem;
    background: rgba(96, 150, 186, 0.1);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    white-space: nowrap;
}

@media (min-width: 480px) {
    .keyboard-hint {
		display:none;
    }
}

.rotation-controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.all-pages-controls h4 {
    color: var(--primary-dark);
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.all-pages-controls .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.all-pages-controls .btn-secondary {
    flex: 2;
    min-width: 100px;
    min-height: 20px;
}

@media (min-width: 640px) {
    .all-pages-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-white);
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    background: var(--text-white);
    color: var(--primary-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.export-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.btn-export {
    position: relative;
    overflow: hidden;
}

.btn-export::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: exportShine 3s infinite linear;
}

@keyframes exportShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.export-info {
    margin-top: 10px;
    padding: 10px;
    background: rgba(163, 206, 241, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--secondary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: center;
    justify-content: center;
}

/* ====== THUMBNAILS SECTION ====== */
.thumbnails-section {
    background: var(--text-white);
    border-radius: var(--radius-xl);
    padding: 25px;
    box-shadow: var(--shadow-lg);
}

.thumbnails-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

@media (min-width: 640px) {
    .thumbnails-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.thumbnails-header h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 20px;
}

.thumbnails-hint {
    color: var(--text-light);
    font-size: 0.9rem;
    background: var(--light-bg);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
    background: var(--light-bg);
    border-radius: var(--radius-lg);
}

@media (max-width: 480px) {
    .thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
}

.thumbnails-grid::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.thumbnails-grid::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: var(--radius-md);
}

.thumbnails-grid::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: var(--radius-md);
}

.thumbnails-grid::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-dark);
}

/* Thumbnail Cards */
.thumbnail-card {
    background: var(--text-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 140px;
}

@media (max-width: 480px) {
    .thumbnail-card {
        height: 120px;
    }
}

.thumbnail-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.thumbnail-card.active {
    border-color: var(--primary-color);
    background: rgba(39, 76, 119, 0.05);
    box-shadow: var(--shadow-md);
}

.thumbnail-card.modified {
    border-color: var(--secondary-color);
    background: rgba(96, 150, 186, 0.05);
}

.thumbnail-card.placeholder {
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-canvas {
    width: 100%;
    flex: 1;
    object-fit: contain;
    background: var(--light-bg);
    border-radius: var(--radius-md);
}

.thumbnail-number {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(39, 76, 119, 0.9);
    color: var(--text-white);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.thumbnail-card.modified .thumbnail-number {
    background: rgba(96, 150, 186, 0.9);
}

.thumbnail-rotation {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-light);
    padding: 4px 8px;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
    justify-content: center;
}

/* ====== FEATURES SECTION ====== */
.features-section {
    background: var(--text-white);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-top: 30px;
    box-shadow: var(--shadow-lg);
}

.features-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

@media (max-width: 640px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    background: var(--light-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    text-align: center;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.feature-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.95rem;
    flex: 1;
}

/* ====== SEO CONTENT SECTION ====== */
.seo-content-section {
    background: var(--text-white);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin: 30px 0;
    box-shadow: var(--shadow-lg);
}

.seo-content h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .faq-grid {
        grid-template-columns: repeat(auto-fit, minmax(auto, 1fr));
        gap: 20px;
    }
}

.faq-item {
    background: var(--light-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    transition: all var(--transition-normal);
}

.faq-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.faq-item h3 {
    font-size: 1.2rem;
    color: var(--primary-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.faq-item h3:before {
    content: "Q:";
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.faq-item p {
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 1rem;
}

.seo-text-content {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.seo-text-content h3 {
    font-size: 1.8rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
}

.seo-text-content h4 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 25px 0 15px;
}

.seo-text-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.seo-text-content ul {
    margin: 20px 0;
    padding-left: 25px;
}

.seo-text-content li {
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text-dark);
    font-size: 1.05rem;
}

.seo-text-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.seo-text-content a:hover {
    border-bottom-color: var(--primary-color);
}

/* ====== LOADING OVERLAY ====== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
    background: var(--text-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.loading-progress {
    margin-top: 20px;
}

.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}



/* ====== UTILITY CLASSES ====== */
.hidden {
    display: none !important;
}

/* ====== NEW FILE BUTTON ====== */
#newFileBtn {
    background: var(--text-white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 100;
    box-shadow: var(--shadow-md);
    min-height: 44px;
}

#newFileBtn:hover {
    background: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ====== ZOOM CONTROLS ====== */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

@media (min-width: 640px) {
    .zoom-controls {
        width: auto;
        justify-content: flex-end;
    }
}

.zoom-label {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.zoom-btn {
    background: var(--text-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    cursor: pointer;
    color: var(--primary-color);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    min-width: 44px;
    min-height: 44px;
}

.zoom-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

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

#zoomRange {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    border-radius: 3px;
    outline: none;
}

#zoomRange::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

#zoomRange::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.zoom-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    background: var(--light-bg);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* ====== MOBILE RESPONSIVENESS ====== */
@media (max-width: 768px) {
    .pdf-rotator-container {
        padding: 15px;
    }
    
    .page-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .upload-section,
    .preview-section,
    .features-section,
    .seo-content-section {
        padding: 20px;
    }
    
    .preview-grid {
        gap: 20px;
    }
    
    .thumbnails-grid {
        max-height: 250px;
    }
    
    #newFileBtn {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 20px;
        width: 100%;
        justify-content: center;
    }
    
    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
    
    .seo-content h2 {
        font-size: 1.6rem;
    }
    
    .seo-text-content h3 {
        font-size: 1.5rem;
    }
    
    .seo-text-content h4 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .pdf-rotator-container {
        padding: 10px;
    }
    
    .page-header {
        padding: 15px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .btn-group {
        grid-template-columns: 1fr;
    }
    
    .thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }
    
    .thumbnail-card {
        height: 120px;
    }
    
    .thumbnail-canvas {
        height: 70px;
    }
    
    .features-section h2,
    .seo-content h2 {
        font-size: 1.4rem;
    }
    
    .feature-icon {
        font-size: 2rem;
    }
    
    .feature-card h3 {
        font-size: 1.1rem;
    }
    
    .feature-card p {
        font-size: 0.9rem;
    }
}

/* ====== PRINT STYLES ====== */
@media print {
    .upload-section,
    .new-file-btn,
    .features-section,
    .seo-content-section,
    .loading-overlay,
    .toast {
        display: none !important;
    }
    
    .pdf-rotator-container {
        padding: 0;
    }
    
    .preview-section {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    
    #mainCanvas {
        max-width: 100% !important;
        max-height: none !important;
        box-shadow: none;
    }
}

/* ====== ACCESSIBILITY ====== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .btn-rotate:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .feature-card:hover,
    .faq-item:hover {
        transform: none !important;
    }
}

/* ====== HIGH CONTRAST MODE ====== */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-light: #000000;
        --light-bg: #ffffff;
    }
    
    .btn-primary,
    .btn-rotate {
        border: 2px solid #000000;
    }
}

/* ====== FOCUS STATES FOR ACCESSIBILITY ====== */
button:focus-visible,
input:focus-visible,
.btn-rotate:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ====== SELECTION STYLES ====== */
::selection {
    background: rgba(39, 76, 119, 0.3);
    color: var(--text-dark);
}

/* ====== TOUCH DEVICE OPTIMIZATIONS ====== */
@media (hover: none) {
    .btn-rotate:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .feature-card:hover,
    .faq-item:hover {
        transform: none;
    }
    
    .btn-rotate:active,
    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.98);
    }
}

/* ====== SCROLLBAR STYLING ====== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: var(--radius-md);
    border: 2px solid var(--light-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-dark);
}

/* ====== PERFORMANCE OPTIMIZATIONS ====== */
@media (prefers-reduced-data: reduce) {
    .upload-icon {
        animation: none;
    }
    
    .btn-export::after {
        animation: none;
    }
}

/* ====== GUIDE TIPS STYLES ====== */
.guide-tips {
    background: linear-gradient(135deg, rgba(163, 206, 241, 0.1), rgba(96, 150, 186, 0.1));
    padding: 20px;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--accent-color);
    margin-top: 20px;
}

.guide-tips h4 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guide-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-tips li {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    padding-left: 24px;
    position: relative;
}

.guide-tips li:before {
    content: "•";
    color: var(--secondary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.guide-tips kbd {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    font-size: 0.8rem;
    font-family: monospace;
    color: var(--primary-color);
}

/* ====== EXPORT DELAY INDICATOR ====== */
.export-delay-indicator {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--secondary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    opacity: 0.9;
    animation: pulse 2s infinite;
}

.export-delay-indicator.hidden {
    display: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.export-progress {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.export-countdown {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 20px;
    text-align: center;
}