/* Hentai Helper Dashboard Styles - Dark Professional Theme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #222222;
    min-height: 100vh;
    padding: 0;
    color: #e0e0e0;
    padding-top: 70px; /* Space for fixed navbar */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #222222;
    border-bottom: 1px solid #333;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.navbar-content {
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    width: 100%;
}

.navbar-brand {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.navbar-brand:hover {
    opacity: 0.8;
}

.navbar-brand h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.5px;
}

.accent-text {
    color: #E54B65;
}

.helper-text {
    font-size: 0.7em;
    font-weight: 500;
}

.navbar-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    color: #999;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #e0e0e0;
    background: #2a2a2a;
}

.nav-link.active {
    color: #E54B65;
    background: rgba(229, 75, 101, 0.1);
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    background: #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid #333;
}

main {
    padding: 50px 40px;
    background: #2a2a2a;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 40px;
    min-height: 0;
}

/* Top Section: Full Width - Header */
.header-section {
    grid-column: 1 / -1;
}

.header-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.header-section .lead {
    font-size: 1.2rem;
    color: #bbb;
    margin-bottom: 0;
    line-height: 1.6;
}

/* Bottom Section: 50/50 Split using Grid */
.bottom-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
    min-width: 0;
}

/* When file-list-section is hidden, upload area takes full width */
.bottom-section.full-width-upload {
    grid-template-columns: 1fr;
}

.bottom-section.full-width-upload .upload-section-wrapper {
    max-width: 900px;
    margin: 0 auto;
    position: static;
}

/* Left: 60% - Features Section */
.file-list-section {
    min-height: 400px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.features {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0;
}

.feature-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    min-width: 0;
}

.feature-icon {
    width: 32px;
    height: 32px;
    color: #E54B65;
    flex-shrink: 0;
    margin-top: 4px;
}

.feature-item > div {
    min-width: 0;
    flex: 1;
}

.feature-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 0.95rem;
    color: #999;
    line-height: 1.5;
    margin: 0;
    word-wrap: break-word;
}

/* Right: 40% - Upload Area */
.upload-section-wrapper {
    position: sticky;
    top: 90px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Upload Section */
.upload-section {
    margin-bottom: 0;
    min-width: 0;
    flex: 1;
}

.upload-area {
    border: 2px dashed #444444;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    background: #222222;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.upload-area.process-state {
    text-align: left;
    padding: 30px;
}

.upload-area:hover {
    border-color: #E54B65;
    background: #252525;
    transform: translateY(-2px);
}

.upload-area.drag-over {
    border-color: #E54B65;
    background: #2a2a2a;
    transform: scale(1.01);
    box-shadow: 0 0 20px rgba(229, 75, 101, 0.2);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #E54B65;
    margin-bottom: 8px;
}

.cover-preview-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #1a1a1a;
}

.cover-preview {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 500px;
}

/* Process state layout: two columns */
.process-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
    width: 100%;
}

.cover-preview-side {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #1a1a1a;
}

.cover-preview-side .cover-preview {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 600px;
}

.folder-info-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: space-between;
    min-height: 100%;
}

.folder-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
    word-wrap: break-word;
}

.page-count {
    font-size: 1.1rem;
    color: #bbb;
    margin: 0;
}

.process-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

@media (max-width: 768px) {
    .process-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cover-preview-side {
        order: 1;
    }
    
    .folder-info-side {
        order: 2;
    }
}

.upload-area h2 {
    font-size: 1.4rem;
    color: #ffffff;
    margin-bottom: 8px;
    font-weight: 600;
}

.upload-area p {
    color: #999;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

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

/* Buttons */
.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: #E54B65;
    color: white;
    box-shadow: 0 4px 12px rgba(229, 75, 101, 0.3);
}

.btn-primary:hover {
    background: #d43d57;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 75, 101, 0.4);
}

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

.btn-secondary {
    background: #444444;
    color: #e0e0e0;
    border: 1px solid #555;
}

.btn-secondary:hover {
    background: #555555;
    border-color: #666;
    transform: translateY(-2px);
}

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

/* File List */
.file-list {
    margin-top: 20px;
    padding: 24px;
    background: #222222;
    border-radius: 12px;
    border: 1px solid #333;
    min-height: 400px;
    min-width: 0;
    flex: 1;
}

.file-list h3 {
    margin-bottom: 18px;
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 600;
}

.file-list-info {
    color: #999;
    font-size: 0.95rem;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: #2a2a2a;
    border-radius: 6px;
    border: 1px solid #333;
}

.file-list ul {
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 24px;
    padding: 12px;
    background: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #333;
}

.file-list li {
    padding: 10px 12px;
    border-bottom: 1px solid #333;
    font-size: 0.95rem;
    color: #bbb;
    transition: background 0.2s ease;
}

.file-list li:hover {
    background: #333;
    border-radius: 4px;
}

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

.file-list-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.file-list .btn {
    margin: 0;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 16px;
    background: #222222;
    border-radius: 8px;
    border: 1px solid #333;
}

.pagination-info {
    color: #bbb;
    font-size: 0.95rem;
    font-weight: 500;
}

.pagination-btn {
    padding: 10px 20px;
    min-width: 100px;
}

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

.pagination-btn:disabled:hover {
    transform: none;
    background: #444444;
}

/* Progress Section (kept for backward compatibility, but hidden during processing) */
.progress-section {
    text-align: center;
    padding: 60px 40px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.progress-section h3 {
    margin-bottom: 32px;
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* Processing Modal Overlay */
.processing-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.processing-modal {
    background: #2a2a2a;
    border-radius: 16px;
    padding: 60px 80px;
    width: 900px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    box-sizing: border-box;
}

.processing-modal h3 {
    margin-bottom: 40px;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.progress-bar-container {
    margin-bottom: 24px;
    width: 100%;
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 16px;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #E54B65 0%, #C93D55 100%);
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    position: relative;
    box-shadow: 0 0 12px rgba(229, 75, 101, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #ffffff;
    font-size: 0.875rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
    transition: color 0.3s ease, left 0.3s ease, right 0.3s ease;
}

.progress-message {
    color: #bbb;
    font-size: 1rem;
    margin-top: 16px;
    font-weight: 400;
    min-height: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Result Section */
.result-section {
    text-align: center;
    padding: 20px 0;
}

.success-message {
    padding: 50px 30px;
}

.success-icon {
    width: 72px;
    height: 72px;
    color: #4caf50;
    margin-bottom: 24px;
}

.success-message h3 {
    font-size: 2rem;
    color: #ffffff;
    margin-bottom: 12px;
    font-weight: 600;
}

.success-message p {
    color: #bbb;
    margin-bottom: 32px;
    font-size: 1.1rem;
}

.success-message .btn {
    margin: 0 12px;
}

/* Error Section */
.error-section {
    text-align: center;
    padding: 20px 0;
}

.error-message {
    padding: 50px 30px;
}

.error-icon {
    width: 72px;
    height: 72px;
    color: #E54B65;
    margin-bottom: 24px;
}

.error-message h3 {
    font-size: 2rem;
    color: #ffffff;
    margin-bottom: 12px;
    font-weight: 600;
}

.error-message p {
    color: #bbb;
    margin-bottom: 32px;
    font-size: 1rem;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
        padding-top: 60px;
        justify-content: flex-start;
        align-items: stretch;
    }
    
    .navbar-content {
        height: 60px;
        padding: 0 10px;
    }
    
    .navbar-brand h1 {
        font-size: 1.5rem;
    }
    
    .navbar-links {
        gap: 12px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .container {
        margin: 10px;
        border-radius: 8px;
    }

    main {
        padding: 30px 20px;
        gap: 30px;
        grid-template-rows: auto auto;
    }
    
    .header-section h1 {
        font-size: 2rem;
    }
    
    .header-section .lead {
        font-size: 1.1rem;
        margin-bottom: 30px;
    }
    
    .features {
        gap: 24px;
    }
    
    .bottom-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Reorder for mobile: upload first, then features */
    .upload-section-wrapper {
        position: static;
        order: -1;
    }
    
    .file-list-section {
        min-height: auto;
        order: 1;
    }
    
    .file-list {
        min-height: auto;
    }

    .upload-area {
        padding: 30px 20px;
    }
    
    .processing-modal {
        padding: 40px 30px;
        width: 95vw;
        max-width: 95vw;
    }
    
    .processing-modal h3 {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    
    .progress-message {
        font-size: 0.9rem;
    }

    .upload-area h2 {
        font-size: 1.3rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 12px;
    }

    .success-message .btn,
    .error-message .btn {
        display: block;
        width: 100%;
        margin: 12px 0;
    }

    .file-list-actions {
        flex-direction: column;
    }
    
    .file-list .btn {
        width: 100%;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .pagination-btn {
        width: 100%;
    }
}

/* Scrollbar Styling */
.file-list ul::-webkit-scrollbar {
    width: 10px;
}

.file-list ul::-webkit-scrollbar-track {
    background: #222222;
    border-radius: 5px;
}

.file-list ul::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 5px;
    border: 2px solid #222222;
}

.file-list ul::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Focus states for accessibility */
.btn:focus {
    outline: 2px solid #E54B65;
    outline-offset: 2px;
}

/* Additional polish */
.container {
    animation: fadeIn 0.4s ease-in;
}

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