/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 3rem;
    color: #ff6b6b;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
    margin-bottom: 15px;
}

/* Designer Credit */
.designer-credit {
    margin-bottom: 25px;
}

.designer-credit p {
    font-size: 0.85rem;
    opacity: 0.8;
    color: #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 6px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    display: inline-flex;
    margin: 0 auto;
}

.designer-credit strong {
    color: #fff;
    font-weight: 600;
}

/* Quick Steps */
.quick-steps {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.step-number {
    background: #ff6b6b;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.step-text {
    font-weight: 500;
    font-size: 0.8rem;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 25px;
    color: white;
}

.section-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.section-header p {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* File Requirements */
.file-requirements {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.file-requirements small {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    background: white;
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-content {
    transition: opacity 0.3s ease;
}

.upload-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #333;
}

.upload-area p {
    color: #666;
    font-size: 0.95rem;
}

.browse-text {
    color: #667eea;
    font-weight: 600;
    text-decoration: underline;
}

/* Progress Bar */
.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-weight: 600;
    color: #667eea;
}

/* File Info Section */
.file-info-section {
    margin-bottom: 30px;
}

.file-info {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.file-details {
    display: flex;
    align-items: center;
    gap: 20px;
}

.file-icon {
    font-size: 3rem;
    color: #ff6b6b;
}

.file-meta h4 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: #333;
}

.file-meta p {
    color: #666;
    margin: 2px 0;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

/* Split Options */
.split-options-section {
    margin-bottom: 30px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.option-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.option-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.option-card.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

.option-card.recommended {
    border-color: #ff6b6b;
}

.option-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff6b6b;
    color: white;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.option-card i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 15px;
}

.option-card.recommended i {
    color: #ff6b6b;
}

.option-card h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #333;
}

.option-card p {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.example {
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
    border-left: 3px solid #667eea;
}

/* Configuration Section */
.config-section {
    margin-bottom: 30px;
}

.config-header {
    margin-bottom: 20px;
    text-align: center;
}

.config-header h3 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.config-header p {
    color: #666;
    font-size: 0.9rem;
}

.config-panel {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Tutorial Card */
.tutorial-card {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.tutorial-card h4 {
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
}

.tutorial-card ul {
    margin: 0;
    padding-left: 18px;
}

.tutorial-card li {
    margin-bottom: 6px;
    color: #555;
    font-size: 0.9rem;
}

.tutorial-card strong {
    color: #667eea;
}

/* Equal Preview */
.equal-preview {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
}

.equal-preview p {
    margin-bottom: 5px;
    color: #0c5460;
}

.equal-preview strong {
    color: #667eea;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.input-group small {
    color: #666;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

/* Advanced Options */
.advanced-options {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.advanced-options h4 {
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.options-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 1rem;
    gap: 12px;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.option-text strong {
    color: #333;
    font-size: 1rem;
}

.option-text small {
    color: #666;
    font-size: 0.85rem;
}

/* Action Section */
.action-section {
    text-align: center;
    margin-bottom: 30px;
}

.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-large {
    font-size: 1rem;
    padding: 16px 30px;
    min-width: 220px;
}

.btn-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.btn-text strong {
    font-size: 1rem;
}

.btn-text small {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Results Section */
.results-section {
    margin-bottom: 30px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.result-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.result-info h4 {
    margin-bottom: 4px;
    color: #333;
    font-size: 1rem;
}

.result-info p {
    color: #666;
    font-size: 0.8rem;
}

.download-btn {
    background: #28a745;
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.download-actions {
    text-align: center;
}

.download-tip {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.download-tip i {
    color: #ffd700;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.processing-animation {
    margin-bottom: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-icon {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 20px;
}

/* Preview Ranges */
.preview-ranges {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    min-height: 50px;
}

.range-item {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    margin: 5px;
    font-size: 0.9rem;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.range-item:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.range-item .remove-range {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
}

.range-item .remove-range:hover {
    opacity: 1;
    color: #ff6b6b;
}

.range-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 5px;
}

/* Range Builder */
.range-builder {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 2px dashed #dee2e6;
}

.range-builder h4 {
    margin-bottom: 12px;
    color: #333;
    text-align: center;
    font-size: 1rem;
}

.builder-controls {
    display: flex;
    gap: 15px;
    align-items: end;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.range-input {
    flex: 1;
    min-width: 120px;
}

.range-input label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.range-input input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
}

.single-page-input {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.single-page-input label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.single-page-input input {
    width: 100px;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
}

.btn-add-range,
.btn-add-page {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-add-range:hover,
.btn-add-page:hover {
    background: #218838;
    transform: translateY(-1px);
}

.range-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.range-actions .btn-secondary {
    font-size: 0.9rem;
    padding: 8px 15px;
}

/* Enhanced preview styles */
.preview-summary {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #0c5460;
}

.preview-empty {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Responsive range builder */
@media (max-width: 768px) {
    .builder-controls {
        flex-direction: column;
    }
    
    .range-input {
        min-width: 100%;
    }
    
    .single-page-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .single-page-input input {
        width: 100%;
    }
    
    .range-actions {
        flex-direction: column;
    }
    
    .range-actions .btn-secondary {
        width: 100%;
    }
}

/* Bookmarks List */
.bookmarks-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
}

.bookmark-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.bookmark-item:last-child {
    border-bottom: none;
}

.bookmark-item label {
    cursor: pointer;
    font-weight: normal;
}

/* Footer */
footer {
    text-align: center;
    padding: 25px 20px;
    color: white;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    border-radius: 15px 15px 0 0;
    margin-top: 40px;
}

footer p {
    margin-bottom: 6px;
    opacity: 0.9;
    font-size: 0.85rem;
}

footer p:last-child {
    margin-bottom: 0;
}

footer strong {
    color: #ffd700;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.7rem;
    }

    .logo i {
        font-size: 2.2rem;
    }

    .quick-steps {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .step {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }

    .upload-area {
        padding: 40px 15px;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .file-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-large {
        min-width: 100%;
        margin-bottom: 10px;
    }

    .btn-secondary {
        width: 100%;
    }

    .tutorial-card ul {
        padding-left: 15px;
    }

    .builder-controls {
        flex-direction: column;
        gap: 10px;
    }

    .range-input {
        min-width: 100%;
    }

    .single-page-input {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .single-page-input input {
        width: 100%;
    }

    .range-actions {
        flex-direction: column;
        gap: 10px;
    }

    .range-actions .btn-secondary {
        width: 100%;
    }

    .download-tip {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 30px 10px;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .config-panel {
        padding: 20px 15px;
    }

    .tutorial-card {
        padding: 15px;
    }

    .section-header h2 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 5px;
    }
}
