/* PDF Converter Tool Styles */

.pdf-converter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.tool-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.tool-description {
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Mode Selector */
.format-mode-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    flex-wrap: wrap;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #6c757d;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.mode-btn:hover {
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.mode-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.mode-icon {
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    position: relative;
}

.format-mode-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.format-mode-content.active {
    display: block;
}

/* Editor Layout */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Sections */
.section-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.form-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

/* Drop Zones */
.pdf-drop-zone,
.batch-drop-zone {
    border: 3px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    margin-bottom: 1rem;
}

.pdf-drop-zone:hover,
.batch-drop-zone:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.pdf-drop-zone.dragover,
.batch-drop-zone.dragover {
    border-color: #28a745;
    background: #f0fff4;
}

.drop-zone-content {
    pointer-events: none;
}

.drop-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    color: #6c757d;
}

.drop-zone-content p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin: 0.5rem 0;
}

.drop-zone-content small {
    color: #6c757d;
}

/* File Info */
.pdf-file-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    font-size: 2rem;
    color: #dc3545;
    min-width: 3rem;
    text-align: center;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.file-meta {
    color: #6c757d;
    font-size: 0.9rem;
}

.file-meta span {
    margin-right: 1rem;
}

.remove-file {
    color: #dc3545;
    border-color: #dc3545;
}

.remove-file:hover {
    background: #dc3545;
    color: #fff;
}

/* Conversion Options */
.conversion-options {
    margin-bottom: 1.5rem;
}

.option-group {
    margin-bottom: 1rem;
}

.option-group label {
    font-weight: 600;
    color: #495057;
    display: block;
    margin-bottom: 0.5rem;
}

.option-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
}

.option-group input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.option-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-outline {
    background: #fff;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.btn-outline:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-icon {
    font-size: 1rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Output Areas */
.editor-textarea {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    background: #f8f9fa;
}

.editor-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.results-container,
.metadata-container {
    min-height: 300px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    background: #f8f9fa;
}

.results-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    font-style: italic;
}

/* Stats */
.output-stats,
.batch-stats {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 100px;
}

.stat-item span:first-child {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item span:last-child {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-top: 0.25rem;
}

/* Batch Files */
.batch-files {
    margin: 1rem 0;
}

.batch-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.batch-file-info {
    flex: 1;
}

.batch-file-name {
    font-weight: 600;
    color: #2c3e50;
}

.batch-file-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

/* History */
.history-section {
    margin-top: 2rem;
}

.history-list {
    margin-bottom: 1rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.history-info {
    flex: 1;
}

.history-type {
    font-weight: 600;
    color: #2c3e50;
}

.history-details {
    font-size: 0.9rem;
    color: #6c757d;
}

.history-time {
    font-size: 0.8rem;
    color: #adb5bd;
}

.no-history {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 1.5rem;
}

.settings-grid {
    display: grid;
    gap: 1rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group label {
    font-weight: 600;
    color: #495057;
}

.setting-group select {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
}

.setting-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.warning {
    border-left: 4px solid #ffc107;
}

.toast.info {
    border-left: 4px solid #007bff;
}

/* Progress */
.progress-container {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #007bff;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.processing {
    animation: pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pdf-converter-container {
        padding: 15px;
        margin: 10px;
    }
    
    .tool-header h1 {
        font-size: 2rem;
    }
    
    .format-mode-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mode-btn {
        justify-content: center;
        padding: 1rem;
    }
    
    .editor-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .output-stats,
    .batch-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stat-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .section-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.8rem;
    }
    
    .tool-description {
        font-size: 1rem;
    }
    
    .drop-icon {
        font-size: 2rem;
    }
    
    .drop-zone-content p {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .modal-container {
        width: 95%;
        margin: 1rem;
    }
}

/* Print Styles */
@media print {
    .pdf-converter-container {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .format-mode-selector,
    .action-buttons,
    .section-actions {
        display: none;
    }
    
    .format-mode-content:not(.active) {
        display: none !important;
    }
}
