/* Critical CSS - Should be inlined in <head> */

:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --dark-color: #16213e;
    --light-color: #f8f9fa;
    --text-color: #e6f1ff;
    --text-secondary: #ccd6f6;
    --text-tertiary: #a8b2d1;
    --gray-color: #6c757d;
    --success-color: #4bb543;
    --error-color: #ff3333;
    --warning-color: #ffcc00;
    --footer-bg: #0a192f;
    --footer-text: #e6f1ff;
    --footer-link: #64ffda;
    --card-bg: rgba(16, 42, 87, 0.7);
    --card-border: rgba(67, 97, 238, 0.2);
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #0a192f;
    background-image: linear-gradient(135deg, #0a192f 0%, #172a45 100%);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    text-align: center;
    padding: 40px 0 30px;
}

.header h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 10px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header .subtitle {
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

.converter-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(5px);
}

.upload-section {
    border: 2px dashed rgba(67, 97, 238, 0.3);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    min-height: 200px;
}


/* Non-Critical CSS - Load this asynchronously */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 25, 47, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.toast {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    color: white;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(150%);
    animation: slideIn 0.5s forwards, fadeOut 0.5s 2.5s forwards;
    background-color: rgba(20, 40, 80, 0.95);
    border-left: 4px solid var(--primary-color);
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
        height: 0;
        padding: 0;
        margin: 0;
    }
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
    color: var(--dark-color);
}

.toast i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.upload-content {
    transition: opacity 0.3s ease;
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-section h3 {
    margin-bottom: 10px;
    color: var(--text-color);
}

.upload-section p {
    color: var(--text-secondary);
    margin: 10px 0;
}

.size-notice {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-top: 15px;
}

.browse-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.browse-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.file-info {
    display: none;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(67, 97, 238, 0.1);
    padding: 12px 20px;
    border-radius: 5px;
    margin-top: 15px;
    color: var(--text-secondary);
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    color: var(--error-color);
    transform: scale(1.2);
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.control-group {
    background-color: rgba(16, 42, 87, 0.5);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 500;
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.control-group select,
.control-group input[type="number"] {
    width: 100%;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(67, 97, 238, 0.3);
    border-radius: 5px;
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.control-group select:focus,
.control-group input[type="number"]:focus {
    border-color: var(--primary-color);
}

select {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid rgba(67, 97, 238, 0.3);
    border-radius: 5px;
    padding: 10px;
    font-size: 1rem;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ccd6f6'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:focus {
    border-color: var(--primary-color);
    outline: none;
}

select option {
    background-color: var(--card-bg);
    color: var(--text-color);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.convert-btn,
.download-all-btn {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.convert-btn {
    background-color: var(--primary-color);
    color: white;
}

.convert-btn:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.download-all-btn {
    background-color: rgba(67, 97, 238, 0.2);
    color: var(--text-color);
    border: 1px solid var(--primary-color);
}

.download-all-btn:hover:not(:disabled) {
    background-color: rgba(67, 97, 238, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.2);
}

.convert-btn:disabled,
.download-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

.progress-container {
    background-color: rgba(16, 42, 87, 0.5);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid var(--card-border);
    display: none;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.time-estimate {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-tertiary);
    text-align: right;
}

.cancel-button {
    background-color: rgba(255, 51, 51, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.cancel-button:hover {
    background-color: rgba(255, 51, 51, 0.2);
}

.results-section {
    background-color: rgba(16, 42, 87, 0.5);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h3 {
    margin: 0;
    color: var(--text-color);
}

.results-actions {
    display: flex;
    gap: 10px;
}

.small-btn {
    background-color: rgba(67, 97, 238, 0.2);
    color: var(--text-color);
    border: 1px solid var(--primary-color);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.small-btn:hover:not(:disabled) {
    background-color: rgba(67, 97, 238, 0.3);
}

.small-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.image-comparison {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.image-wrapper {
    flex: 1;
    min-width: 300px;
}

.image-wrapper img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: rgba(0, 0, 0, 0.1);
}

.image-label {
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
    color: var(--gray-color);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.result-item {
    background-color: rgba(10, 25, 47, 0.7);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-info {
    margin-top: 10px;
}

.result-info p {
    margin: 5px 0;
    color: var(--text-color);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    font-size: 0.9rem;
}

.file-stats span {
    background-color: rgba(67, 97, 238, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.file-stats .success {
    color: var(--success-color);
}

.file-stats .warning {
    color: var(--warning-color);
}

.file-stats .danger {
    color: var(--error-color);
}

.result-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.download-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    display: inline-block;
    margin-top: 15px;
    width: 100%;
    text-align: center;
}

.download-btn:hover {
    background-color: var(--primary-dark);
}

.text-result-container {
    margin-top: 20px;
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--card-border);
}

.text-result {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    background-color: rgba(10, 25, 47, 0.7);
    border: 1px solid var(--card-border);
    border-radius: 5px;
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
}

.text-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.image-preview-item {
    background-color: rgba(16, 42, 87, 0.3);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
    overflow: hidden;
}

.image-preview-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.image-preview-item img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 5px;
    background-color: var(--dark-color);
    margin-bottom: 10px;
}

.image-preview-item p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-preview-container {
    width: 100%;
    margin: 20px 0;
}

.seo-content {
    background-color: rgba(10, 25, 47, 0.5);
    padding: 40px 0;
    border-top: 1px solid rgba(67, 97, 238, 0.2);
}

.seo-content h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.seo-content h3 {
    color: var(--text-color);
    font-size: 1.4rem;
    margin: 30px 0 15px;
}

.seo-content p,
.seo-content li {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 15px;
}

.seo-content ol,
.seo-content ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.seo-content li {
    margin-bottom: 10px;
}

.seo-content strong {
    color: var(--text-color);
}

.faq-item {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.faq-question {
    width: 100%;
    padding: 15px 20px;
    background-color: rgba(67, 97, 238, 0.2);
    color: var(--text-color);
    border: none;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover,
.faq-question.active {
    background-color: var(--primary-color);
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-question.active i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0;
    background-color: rgba(16, 42, 87, 0.5);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer p {
    padding: 20px;
    color: var(--text-secondary);
    margin: 0;
}

.faq-answer.show {
    max-height: 500px;
}

.footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 40px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(67, 97, 238, 0.2);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--footer-text);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--footer-text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--footer-link);
    transform: translateY(-2px);
}

.footer-copyright {
    color: var(--footer-text);
    opacity: 0.7;
    font-size: 0.9rem;
}

.upload-stats {
    display: none;
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(16, 42, 87, 0.5);
    border-radius: 5px;
    font-size: 0.9rem;
}

.upload-speed,
.upload-time {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.upload-progress .progress-bar {
    flex-grow: 1;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress .progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.results-grid::-webkit-scrollbar {
    width: 8px;
}

.results-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.results-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.results-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-pop {
    animation: popIn 0.3s ease forwards;
}

.drag-over {
    border-color: var(--primary-color) !important;
    background-color: rgba(67, 97, 238, 0.05) !important;
}

.drag-text {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-top: 10px;
    display: none;
}

@media (min-width: 768px) {
    .drag-text {
        display: block;
    }
}

.upload-progress-container {
    margin-top: 20px;
    background-color: rgba(16, 42, 87, 0.5);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.processing-text {
    margin-top: 20px;
    color: var(--text-color);
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: 1fr;
    }
    .action-buttons {
        flex-direction: column;
    }
    .convert-btn,
    .download-all-btn {
        width: 100%;
    }
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .results-actions {
        width: 100%;
        justify-content: space-between;
    }
    .results-grid {
        grid-template-columns: 1fr;
    }
    .image-comparison {
        flex-direction: column;
    }
    .image-wrapper {
        min-width: 100%;
    }
    .image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .converter-card {
        padding: 20px;
    }
    .upload-section {
        padding: 30px 15px;
    }
    .upload-icon {
        font-size: 2.5rem;
    }
    .results-actions {
        flex-direction: column;
        gap: 10px;
    }
    .small-btn {
        width: 100%;
    }
    .image-preview-grid {
        grid-template-columns: 1fr;
    }
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .small-btn {
        flex: 1;
        text-align: center;
    }
}


/* Font face with display: swap */

@font-face {
    font-family: 'Segoe UI';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Segoe UI'), local('SegoeUI');
}


/* Print styles */

@media print {
    .no-print {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
    .converter-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}