/* File Converter Styles */

/* Navigation Header - Dark Background for Good Visibility */
.tool-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-home {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #818cf8;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.back-home:hover {
    background: rgba(129, 140, 248, 0.2);
    transform: translateX(-2px);
}

.back-home svg {
    width: 20px;
    height: 20px;
}

.tool-header-logo {
    height: 32px;
    width: auto;
}

/* General styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f1419 100%);
    min-height: 100vh;
    color: #e0e0e0;
    overflow-x: hidden;
}

/* Background pattern for visual effect */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: radial-gradient(circle at 25% 25%, #4facfe 0%, transparent 50%),
                      radial-gradient(circle at 75% 75%, #00f2fe 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Main container for content */
.container {
    position: relative;
    max-width: 1400px;
    margin: 60px auto 0;
    padding: 20px;
    z-index: 1;
}

/* Header styling */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
}

.header h1 {
    font-size: 3.5em;
    font-weight: 700;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: -0.02em;
}

.header p {
    font-size: 1.3em;
    color: #a0a0a0;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Glassmorphism card effect */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

/* Tool selection grid */
.tool-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

/* Individual tool card styling */
.tool-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-8px);
    border-color: rgba(79, 172, 254, 0.4);
    box-shadow: 0 25px 50px rgba(79, 172, 254, 0.2);
}

.tool-card.active {
    border-color: #4facfe;
    background: rgba(79, 172, 254, 0.1);
    transform: translateY(-4px);
}

.tool-card .icon {
    font-size: 3em;
    margin-bottom: 20px;
    display: block;
}

.tool-card h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: 600;
}

.tool-card p {
    color: #b0b0b0;
    line-height: 1.6;
}

/* File upload area */
.upload-area {
    border: 3px dashed rgba(79, 172, 254, 0.3);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.4s ease;
    background: rgba(255, 255, 255, 0.02);
    display: none;
}

.upload-area.active {
    display: block;
}

.upload-area:hover {
    background: rgba(79, 172, 254, 0.05);
    border-color: #4facfe;
    transform: scale(1.02);
}

.upload-area.dragover {
    background: rgba(79, 172, 254, 0.1);
    border-color: #00f2fe;
    transform: scale(1.05);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
    color: #4facfe;
}

.upload-area h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.upload-area p {
    color: #a0a0a0;
    margin-bottom: 25px;
}

.file-input {
    display: none;
}

.upload-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
}

.upload-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(79, 172, 254, 0.4);
}

/* Settings panel */
.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.setting-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.setting-group:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(79, 172, 254, 0.3);
}

.setting-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #fff;
    font-size: 0.95em;
}

.setting-group input, .setting-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 1em;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    transition: all 0.3s ease;
}

.setting-group input:focus, .setting-group select:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

.range-container {
    position: relative;
}

.range-value {
    display: block;
    text-align: center;
    margin-top: 8px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    font-size: 1em;
}

/* File list display */
.file-list {
    display: none;
}

.file-list.active {
    display: block;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.file-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(79, 172, 254, 0.3);
    transform: translateY(-2px);
}

.file-preview {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    font-size: 0.8em;
    flex-shrink: 0;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.file-details {
    flex-grow: 1;
}

.file-details h4 {
    color: #fff;
    margin-bottom: 8px;
    font-size: 1.1em;
    word-break: break-word;
}

.file-details p {
    color: #a0a0a0;
    font-size: 0.9em;
    margin-bottom: 4px;
}

.file-dimensions {
    color: #4facfe;
    font-weight: 600;
    font-size: 0.85em;
}

.file-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    flex: 1;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #4facfe;
}

.action-btn.danger {
    background: rgba(255, 59, 48, 0.2);
    border-color: rgba(255, 59, 48, 0.4);
}

.action-btn.danger:hover {
    background: rgba(255, 59, 48, 0.3);
}

/* Process button */
.process-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 16px;
    font-size: 1.3em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    display: none;
    margin: 30px auto;
    box-shadow: 0 15px 35px rgba(79, 172, 254, 0.3);
    letter-spacing: 0.5px;
}

.process-btn.active {
    display: block;
}

.process-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 45px rgba(79, 172, 254, 0.4);
}

.process-btn:disabled {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Progress container */
.progress-container {
    display: none;
}

.progress-container.active {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 20px;
}

.progress-text {
    text-align: center;
    color: #fff;
    font-weight: 600;
    font-size: 1.1em;
}

/* Results container */
.results-container {
    display: none;
}

.results-container.active {
    display: block;
}

.download-all-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
}

.download-all-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(79, 172, 254, 0.4);
}

/* Privacy notice styling */
.privacy-notice {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
}

.privacy-notice h3 {
    color: #00f2fe;
    margin-bottom: 12px;
    font-size: 1.2em;
}

.privacy-notice p {
    color: #b0f0f0;
    line-height: 1.6;
}

/* Section titles */
.section-title {
    color: #fff;
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Styles for draggable file items */
.draggable-file-item {
    cursor: grab;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.draggable-file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.draggable-file-item.dragging {
    opacity: 0.7;
    transform: scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.draggable-file-item .file-name {
    font-weight: 600;
    color: #fff;
    flex-grow: 1;
}

.draggable-file-item .page-count {
    font-size: 0.9em;
    color: #b0b0b0;
}

.drag-handle {
    cursor: grab;
    font-size: 1.5em;
    color: #4facfe;
    margin-right: 10px;
}

.merge-files-container {
    display: none;
    margin-top: 20px;
}

.merge-files-container.active {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tool-header {
        padding: 10px 15px;
    }

    .back-home {
        font-size: 13px;
        padding: 6px 12px;
    }

    .tool-header-logo {
        height: 28px;
    }

    .container {
        padding: 15px;
        margin-top: 56px;
    }

    .header h1 {
        font-size: 2.5em;
    }

    .tool-selector {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .file-grid {
        grid-template-columns: 1fr;
    }

    .upload-area {
        padding: 40px 20px;
    }
}

/* Floating Start Fresh Button */
.start-fresh-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(238, 90, 111, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
}

.start-fresh-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(238, 90, 111, 0.5);
    background: linear-gradient(135deg, #ee5a6f, #ff6b6b);
}

.start-fresh-btn:active {
    transform: translateY(-2px);
}

.start-fresh-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

@media (max-width: 768px) {
    .start-fresh-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 0.9em;
    }

    .start-fresh-btn span {
        display: none;
    }

    .start-fresh-btn svg {
        width: 24px;
        height: 24px;
        margin: 0;
    }
}
