:root {
    --primary: #4a6ee0;
    --primary-dark: #3a5ac8;
    --secondary: #ff6b6b;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --success: #28a745;
    --border-radius: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fb;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* Header Styles */

header {
    background-color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    margin-right: 10px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}


/* Hero Section */

.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.hero p {
    font-size: 1.1rem;
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto 30px;
}

.tools-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.tab-btn {
    background: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #e9ecef;
}


/* Tool Sections */

.tool-section {
    display: none;
}

.tool-section.active {
    display: block;
}

.tool-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 40px;
    min-height: 400px;
}


/* Upload Area */

.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary);
}

.upload-area.has-files {
    border-color: var(--success);
    background: rgba(40, 167, 69, 0.05);
}

.upload-area.has-files i {
    color: var(--success);
}

.upload-area i {
    font-size: 48px;
    color: var(--gray);
    margin-bottom: 15px;
}

.upload-area h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.upload-area p {
    color: var(--gray);
    margin-bottom: 15px;
}


/* Buttons */

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    text-decoration: none;
    font-size: 1rem;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn .fa-spin {
    margin-right: 8px;
}

.btn-secondary {
    background: var(--secondary);
}

.btn-secondary:hover {
    background: #ff5252;
}


/* File Selection Info */

.file-selection-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(74, 110, 224, 0.1);
    border-radius: var(--border-radius);
    border: 1px solid rgba(74, 110, 224, 0.2);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-count {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}

.file-count i {
    font-size: 1.2rem;
}

.file-names {
    max-height: 120px;
    overflow-y: auto;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.file-name-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #f8f9fa;
}

.file-name-item:last-child {
    border-bottom: none;
}

.file-name-item i {
    color: var(--success);
    font-size: 0.8rem;
    min-width: 16px;
}

.file-name-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: var(--gray);
    font-size: 0.8rem;
    min-width: 60px;
    text-align: right;
}


/* Scrollbar for file names */

.file-names::-webkit-scrollbar {
    width: 6px;
}

.file-names::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.file-names::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.file-names::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


/* Options Panel */

.options-panel {
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
}

.options-panel h3 {
    margin-bottom: 15px;
    color: var(--dark);
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
}

.radio-option input,
.checkbox-option input {
    margin-right: 8px;
}

.select-group {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--border-radius);
    border: 1px solid #d1d5db;
    background: white;
    font-size: 1rem;
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group input {
    flex: 1;
    padding: 10px 12px;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    border: 1px solid #d1d5db;
    border-right: none;
    font-size: 1rem;
}

.input-group span {
    background: var(--light);
    padding: 10px 12px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    border: 1px solid #d1d5db;
    border-left: none;
}


/* Image Preview */

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    min-height: 100px;
}

.preview-item {
    position: relative;
    width: 120px;
    height: 150px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.preview-item:hover {
    transform: translateY(-2px);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: var(--secondary);
    transition: var(--transition);
}

.preview-item .remove-btn:hover {
    background: var(--secondary);
    color: white;
}


/* PDF Preview */

.pdf-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    min-height: 100px;
}

.preview-pdf-item {
    position: relative;
    width: 120px;
    height: 170px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--light);
    border: 2px solid transparent;
    transition: var(--transition);
}

.preview-pdf-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.preview-pdf-item .pdf-icon {
    width: 100%;
    height: 120px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.preview-pdf-item .pdf-info {
    padding: 10px;
    text-align: center;
}

.preview-pdf-item .pdf-name {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.preview-pdf-item .pdf-size {
    font-size: 0.7rem;
    color: var(--gray);
}

.preview-pdf-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: var(--secondary);
    transition: var(--transition);
}

.preview-pdf-item .remove-btn:hover {
    background: var(--secondary);
    color: white;
}

.preview-pdf-item .page-count {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
}


/* Empty state for preview areas */

.preview-empty {
    text-align: center;
    color: var(--gray);
    padding: 40px;
    width: 100%;
}

.preview-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}


/* Progress bar */

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin: 15px 0;
    display: none;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    width: 0%;
    transition: width 0.3s ease;
}


/* Results Panel */

.results-panel {
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 30px;
    display: none;
}

.results-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.file-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.file-info-item {
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.file-info-item .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.file-info-item .label {
    font-size: 0.9rem;
    color: var(--gray);
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}


/* Status messages */

.status-message {
    padding: 12px 15px;
    border-radius: var(--border-radius);
    margin: 10px 0;
    display: none;
    animation: fadeIn 0.3s ease;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}


/* Actions */

.actions {
    text-align: center;
    margin-top: 20px;
}


/* Footer */

footer {
    background: var(--dark);
    color: white;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-section {
    flex: 1;
    min-width: 250px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #adb5bd;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
    color: #adb5bd;
    font-size: 0.9rem;
}


/* Drag over state */

.drag-over {
    border: 2px dashed var(--primary) !important;
    background: rgba(74, 110, 224, 0.1) !important;
}


/* Responsive styles */

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }
    .nav-links {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .nav-links li {
        margin: 5px 10px;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .tools-tabs {
        flex-direction: column;
        align-items: center;
    }
    .tab-btn {
        width: 100%;
        max-width: 300px;
        margin-bottom: 5px;
    }
    .file-info {
        flex-direction: column;
        gap: 15px;
    }
    .preview-actions {
        flex-direction: column;
    }
    .footer-content {
        flex-direction: column;
    }
    .tool-container {
        padding: 20px;
    }
    .upload-area {
        padding: 30px 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    .hero {
        padding: 40px 0 20px;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .tool-container {
        padding: 15px;
    }
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}