/* HTML Formatter Styles */
.html-formatter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.html-formatter-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

.html-formatter-header h2 {
    margin: 0 0 10px 0;
    font-size: 2rem;
}

.html-formatter-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.html-formatter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 0.9rem;
}

.form-control {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.html-formatter-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 20px;
}

.input-section,
.output-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-method {
    margin-bottom: 20px;
}

.input-method label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

#html-input,
#html-output {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: #f8f9fa;
    transition: border-color 0.3s ease;
}

#html-input:focus,
#html-output:focus {
    outline: none;
    border-color: #667eea;
}

.file-input {
    width: 100%;
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input:hover {
    border-color: #667eea;
    background: #e9ecef;
}

.file-info {
    margin-top: 10px;
    padding: 10px;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-2px);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.output-header h3 {
    margin: 0;
    color: #333;
}

.output-actions {
    display: flex;
    gap: 8px;
}

.preview-section {
    margin-top: 25px;
}

.preview-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.preview-container {
    position: relative;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

#preview-frame {
    width: 100%;
    height: 300px;
    border: none;
    background: white;
}

.preview-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #f8f9fa;
    color: #6c757d;
    text-align: center;
}

.preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.preview-placeholder p {
    margin: 0;
    font-size: 1.1rem;
}

.html-formatter-footer {
    text-align: center;
    padding: 15px;
    background: #e7f3ff;
    border-radius: 6px;
    color: #0066cc;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .html-formatter-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .html-formatter-controls {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .output-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .output-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
    }
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success States */
.success {
    background: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
}

/* Error States */
.error {
    background: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
}