/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header h1 i {
    color: #e74c3c;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content Layout */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Upload Section */
.upload-section {
    background-color: #fff;
    border-radius: 16px;
    padding: 40px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.upload-area {
    border: 3px dashed #3498db;
    border-radius: 12px;
    padding: 60px 30px;
    text-align: center;
    background-color: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    background-color: #e8f4fc;
    border-color: #2980b9;
}

.upload-area.dragover {
    background-color: #e1f0fa;
    border-color: #1abc9c;
    border-style: solid;
}

.upload-icon {
    font-size: 3.5rem;
    color: #3498db;
    margin-bottom: 20px;
}

.upload-area h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.upload-description {
    color: #7f8c8d;
    margin-bottom: 25px;
    font-size: 1.05rem;
}

.file-input {
    display: none;
}

.btn {
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.3);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
}

.btn-download {
    background-color: #27ae60;
    color: white;
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-download:hover {
    background-color: #219653;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.file-restriction {
    margin-top: 20px;
    color: #95a5a6;
    font-size: 0.9rem;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
    padding: 20px;
    background-color: #f1f8e9;
    border-radius: 10px;
    border-left: 4px solid #8bc34a;
}

.security-note i {
    color: #689f38;
    font-size: 1.3rem;
}

.security-note p {
    color: #33691e;
    font-weight: 500;
}

/* PDF Info Section */
.pdf-info-section, .options-section, .results-section {
    background-color: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.pdf-info-card, .options-card, .results-card {
    width: 100%;
}

.pdf-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.pdf-info-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #95a5a6;
    cursor: pointer;
    transition: color 0.3s;
    padding: 5px;
    border-radius: 5px;
}

.btn-icon:hover {
    color: #e74c3c;
    background-color: #f9f9f9;
}

.pdf-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.pdf-detail {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.detail-label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 500;
}

/* Options Section */
.options-card h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-group {
    margin-bottom: 30px;
}

.option-group h4 {
    font-size: 1.2rem;
    color: #34495e;
    margin-bottom: 15px;
}

.option-item {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.option-item:hover {
    border-color: #3498db;
    background-color: #f8fafc;
}

.option-item input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.option-item label {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.option-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.option-desc {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Custom Range Input */
.custom-range-container {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.custom-range-container label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.input-with-example {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#rangeInput {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#rangeInput:focus {
    border-color: #3498db;
    outline: none;
}

.btn-help {
    background-color: #ecf0f1;
    border: none;
    border-radius: 8px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #7f8c8d;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.btn-help:hover {
    background-color: #3498db;
    color: white;
}

.range-example {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 8px;
}

.range-error {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 12px 16px;
    background-color: #ffebee;
    border-radius: 8px;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.range-error i {
    font-size: 1.2rem;
}

.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

/* Results Section */
.results-header {
    margin-bottom: 25px;
}

.results-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.results-header h3 i {
    color: #27ae60;
}

.results-summary {
    padding: 15px;
    background-color: #e8f5e9;
    border-radius: 8px;
    color: #2e7d32;
}

.results-preview {
    margin-bottom: 30px;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-pages {
    font-weight: 600;
    color: #2c3e50;
}

.result-size {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.download-action {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.download-note {
    margin-top: 15px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.processing-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f0f0f0;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    margin: 0 auto 25px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-content h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

#processingMessage {
    color: #7f8c8d;
    margin-bottom: 25px;
}

.progress-container {
    height: 10px;
    background-color: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background-color: #3498db;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-weight: 600;
    color: #2c3e50;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
}

.modal-body {
    padding: 30px;
}

.help-list {
    margin: 20px 0;
    padding-left: 20px;
}

.help-list li {
    margin-bottom: 10px;
    color: #555;
}

.example-box {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 25px;
    border-left: 4px solid #3498db;
}

.example-box ol {
    margin-top: 10px;
    padding-left: 20px;
}

.example-box li {
    margin-bottom: 8px;
    color: #555;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
    color: #7f8c8d;
    font-size: 0.95rem;
}

.footer i.fa-heart {
    color: #e74c3c;
}

.footer-note {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #95a5a6;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-icon {
        font-size: 2.8rem;
    }
    
    .pdf-details {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .input-with-example {
        flex-direction: column;
    }
    
    .btn-help {
        align-self: flex-start;
    }
}