/**
 * HTML to PDF Tool - Styles
 * Modern, responsive, and clean design
 */

/* CSS Variables */
:root {
    --html-to-pdf-primary: #2563eb;
    --html-to-pdf-primary-dark: #1d4ed8;
    --html-to-pdf-primary-light: #3b82f6;
    --html-to-pdf-success: #10b981;
    --html-to-pdf-success-dark: #059669;
    --html-to-pdf-warning: #f59e0b;
    --html-to-pdf-danger: #ef4444;
    --html-to-pdf-danger-dark: #dc2626;
    --html-to-pdf-gray-50: #f9fafb;
    --html-to-pdf-gray-100: #f3f4f6;
    --html-to-pdf-gray-200: #e5e7eb;
    --html-to-pdf-gray-300: #d1d5db;
    --html-to-pdf-gray-400: #9ca3af;
    --html-to-pdf-gray-500: #6b7280;
    --html-to-pdf-gray-600: #4b5563;
    --html-to-pdf-gray-700: #374151;
    --html-to-pdf-gray-800: #1f2937;
    --html-to-pdf-gray-900: #111827;
    --html-to-pdf-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --html-to-pdf-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --html-to-pdf-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --html-to-pdf-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --html-to-pdf-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --html-to-pdf-radius: 8px;
    --html-to-pdf-radius-lg: 12px;
    --html-to-pdf-transition: all 0.2s ease-in-out;
}

/* Main Container */
.html-to-pdf-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 900px;
    margin: 30px auto;
    padding: 0;
    background: #ffffff;
    border-radius: var(--html-to-pdf-radius-lg);
    box-shadow: var(--html-to-pdf-shadow-xl);
    overflow: hidden;
    position: relative;
}

/* Header */
.html-to-pdf-header {
    background: linear-gradient(135deg, var(--html-to-pdf-primary) 0%, var(--html-to-pdf-primary-dark) 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.html-to-pdf-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.html-to-pdf-logo i {
    font-size: 32px;
    color: white;
}

.html-to-pdf-logo h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.html-to-pdf-description {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Tabs */
.html-to-pdf-tabs {
    display: flex;
    background: var(--html-to-pdf-gray-100);
    border-bottom: 1px solid var(--html-to-pdf-gray-200);
}

.html-to-pdf-tab {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--html-to-pdf-gray-600);
    cursor: pointer;
    transition: var(--html-to-pdf-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.html-to-pdf-tab:hover {
    background: var(--html-to-pdf-gray-50);
    color: var(--html-to-pdf-primary);
}

.html-to-pdf-tab.active {
    background: white;
    color: var(--html-to-pdf-primary);
}

.html-to-pdf-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--html-to-pdf-primary);
    border-radius: 3px 3px 0 0;
}

.html-to-pdf-tab i {
    font-size: 16px;
}

/* Content Area */
.html-to-pdf-content {
    padding: 25px;
    position: relative;
}

/* Panels */
.html-to-pdf-panel {
    display: none;
}

.html-to-pdf-panel.active {
    display: block;
}

/* Input Groups */
.html-to-pdf-input-group {
    margin-bottom: 20px;
}

.html-to-pdf-input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--html-to-pdf-gray-700);
}

.html-to-pdf-input-group label i {
    margin-right: 6px;
    color: var(--html-to-pdf-primary);
}

/* Textarea */
.html-to-pdf-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid var(--html-to-pdf-gray-200);
    border-radius: var(--html-to-pdf-radius);
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    color: var(--html-to-pdf-gray-800);
    resize: vertical;
    transition: var(--html-to-pdf-transition);
}

.html-to-pdf-textarea:focus {
    outline: none;
    border-color: var(--html-to-pdf-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.html-to-pdf-textarea::placeholder {
    color: var(--html-to-pdf-gray-400);
}

/* Input */
.html-to-pdf-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--html-to-pdf-gray-200);
    border-radius: var(--html-to-pdf-radius);
    font-size: 14px;
    color: var(--html-to-pdf-gray-800);
    transition: var(--html-to-pdf-transition);
}

.html-to-pdf-input:focus {
    outline: none;
    border-color: var(--html-to-pdf-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.html-to-pdf-input::placeholder {
    color: var(--html-to-pdf-gray-400);
}

/* URL Wrapper */
.html-to-pdf-url-wrapper {
    display: flex;
    gap: 10px;
}

.html-to-pdf-url-wrapper .html-to-pdf-input {
    flex: 1;
}

/* URL Status */
.html-to-pdf-url-status {
    margin-top: 10px;
    font-size: 13px;
}

.html-to-pdf-url-status span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
}

.html-to-pdf-url-status .status-fetching {
    background: rgba(37, 99, 235, 0.1);
    color: var(--html-to-pdf-primary);
}

.html-to-pdf-url-status .status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--html-to-pdf-success);
}

.html-to-pdf-url-status .status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--html-to-pdf-danger);
}

/* Select */
.html-to-pdf-select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--html-to-pdf-gray-200);
    border-radius: var(--html-to-pdf-radius);
    font-size: 14px;
    color: var(--html-to-pdf-gray-800);
    background: white;
    cursor: pointer;
    transition: var(--html-to-pdf-transition);
}

.html-to-pdf-select:focus {
    outline: none;
    border-color: var(--html-to-pdf-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Input Actions */
.html-to-pdf-input-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Settings */
.html-to-pdf-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--html-to-pdf-gray-50);
    border-radius: var(--html-to-pdf-radius);
    border: 1px solid var(--html-to-pdf-gray-200);
}

.html-to-pdf-setting {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.html-to-pdf-setting label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--html-to-pdf-gray-600);
}

.html-to-pdf-setting label i {
    color: var(--html-to-pdf-primary);
    font-size: 14px;
}

/* Toggle Switch */
.html-to-pdf-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.html-to-pdf-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.html-to-pdf-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--html-to-pdf-gray-300);
    transition: 0.3s;
    border-radius: 26px;
}

.html-to-pdf-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: var(--html-to-pdf-shadow-sm);
}

.html-to-pdf-toggle input:checked + .html-to-pdf-toggle-slider {
    background-color: var(--html-to-pdf-primary);
}

.html-to-pdf-toggle input:checked + .html-to-pdf-toggle-slider:before {
    transform: translateX(22px);
}

.html-to-pdf-setting-toggle {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

/* Buttons */
.html-to-pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--html-to-pdf-radius);
    cursor: pointer;
    transition: var(--html-to-pdf-transition);
    white-space: nowrap;
}

.html-to-pdf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.html-to-pdf-btn i {
    font-size: 16px;
}

/* Primary Button */
.html-to-pdf-btn-primary {
    background: linear-gradient(135deg, var(--html-to-pdf-primary) 0%, var(--html-to-pdf-primary-dark) 100%);
    color: white;
    box-shadow: var(--html-to-pdf-shadow-md);
}

.html-to-pdf-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--html-to-pdf-shadow-lg);
}

.html-to-pdf-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Secondary Button */
.html-to-pdf-btn-secondary {
    background: var(--html-to-pdf-gray-100);
    color: var(--html-to-pdf-gray-700);
    border: 1px solid var(--html-to-pdf-gray-300);
}

.html-to-pdf-btn-secondary:hover:not(:disabled) {
    background: var(--html-to-pdf-gray-200);
    color: var(--html-to-pdf-gray-800);
}

.html-to-pdf-btn-secondary.success {
    background: var(--html-to-pdf-success);
    color: white;
    border-color: var(--html-to-pdf-success);
}

/* Small Button */
.html-to-pdf-btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

/* Action Buttons */
.html-to-pdf-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.html-to-pdf-output-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Preview Container */
.html-to-pdf-preview-container {
    margin-top: 20px;
    border: 2px solid var(--html-to-pdf-gray-200);
    border-radius: var(--html-to-pdf-radius);
    overflow: hidden;
}

.html-to-pdf-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--html-to-pdf-gray-100);
    border-bottom: 1px solid var(--html-to-pdf-gray-200);
}

.html-to-pdf-preview-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--html-to-pdf-gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
}

.html-to-pdf-preview-header h3 i {
    color: var(--html-to-pdf-primary);
}

.html-to-pdf-preview-content {
    max-height: 400px;
    overflow: auto;
    padding: 20px;
    background: white;
}

/* PDF Output */
.html-to-pdf-output {
    margin-top: 20px;
    padding: 30px;
    background: linear-gradient(135deg, var(--html-to-pdf-gray-50) 0%, white 100%);
    border: 2px solid var(--html-to-pdf-success);
    border-radius: var(--html-to-pdf-radius-lg);
}

.html-to-pdf-success {
    text-align: center;
    margin-bottom: 20px;
}

.html-to-pdf-success i {
    font-size: 48px;
    color: var(--html-to-pdf-success);
    margin-bottom: 10px;
}

.html-to-pdf-success h3 {
    margin: 0 0 5px;
    font-size: 20px;
    color: var(--html-to-pdf-gray-800);
}

.html-to-pdf-success p {
    margin: 0;
    color: var(--html-to-pdf-gray-600);
    font-size: 14px;
}

.html-to-pdf-download-area {
    border: 1px solid var(--html-to-pdf-gray-200);
    border-radius: var(--html-to-pdf-radius);
    overflow: hidden;
    background: white;
}

.html-to-pdf-download-area iframe {
    display: block;
    border: none;
}

/* Loading Overlay */
.html-to-pdf-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.html-to-pdf-spinner {
    text-align: center;
}

.html-to-pdf-spinner-inner {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: var(--html-to-pdf-shadow-lg);
}

.html-to-pdf-spinner i {
    font-size: 28px;
    color: var(--html-to-pdf-primary);
}

.html-to-pdf-spinner p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--html-to-pdf-gray-600);
}

/* Error Message */
.html-to-pdf-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--html-to-pdf-radius);
    margin-top: 15px;
}

.html-to-pdf-error i {
    color: var(--html-to-pdf-danger);
    font-size: 18px;
}

.html-to-pdf-error span {
    flex: 1;
    font-size: 14px;
    color: var(--html-to-pdf-danger);
}

.html-to-pdf-error-close {
    background: none;
    border: none;
    color: var(--html-to-pdf-danger);
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    opacity: 0.7;
    transition: var(--html-to-pdf-transition);
}

.html-to-pdf-error-close:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .html-to-pdf-container {
        margin: 15px;
        border-radius: var(--html-to-pdf-radius);
    }

    .html-to-pdf-header {
        padding: 20px;
    }

    .html-to-pdf-logo h2 {
        font-size: 20px;
    }

    .html-to-pdf-content {
        padding: 15px;
    }

    .html-to-pdf-tabs {
        flex-direction: column;
    }

    .html-to-pdf-tab {
        border-bottom: 1px solid var(--html-to-pdf-gray-200);
    }

    .html-to-pdf-tab.active::after {
        display: none;
    }

    .html-to-pdf-settings {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .html-to-pdf-actions {
        flex-direction: column;
    }

    .html-to-pdf-btn {
        width: 100%;
    }

    .html-to-pdf-url-wrapper {
        flex-direction: column;
    }

    .html-to-pdf-input-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .html-to-pdf-logo {
        flex-direction: column;
        gap: 8px;
    }

    .html-to-pdf-logo i {
        font-size: 28px;
    }

    .html-to-pdf-output-actions {
        flex-direction: column;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.html-to-pdf-container {
    animation: fadeIn 0.3s ease-out;
}

/* Print Styles */
@media print {
    .html-to-pdf-header,
    .html-to-pdf-tabs,
    .html-to-pdf-content,
    .html-to-pdf-actions,
    .html-to-pdf-preview-header,
    .html-to-pdf-close-preview {
        display: none !important;
    }

    .html-to-pdf-preview-content {
        max-height: none !important;
        overflow: visible !important;
    }
}
