/**
 * Modern stylesheet for TXT to PDF Tool.
 * Features an elegant card dashboard, professional contrast typography, CSS Grid system,
 * visual hierarchy depth layers, transition states, and deep dark theme capabilities.
 */

:root {
    --t2p-primary: #3b82f6;
    --t2p-primary-hover: #2563eb;
    --t2p-accent: #10b981;
    --t2p-bg-page: #f8fafc;
    --t2p-bg-card: #ffffff;
    --t2p-text-main: #1e293b;
    --t2p-text-muted: #64748b;
    --t2p-border: #e2e8f0;
    --t2p-danger: #ef4444;
    --t2p-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --t2p-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --t2p-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --t2p-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Wrapper Containment */
.txt2pdf-wrapper {
    background-color: var(--t2p-bg-page);
    color: var(--t2p-text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    padding: 24px;
    border-radius: 16px;
    max-width: 1200px;
    margin: 30px auto;
    box-shadow: var(--t2p-shadow-sm);
    transition: var(--t2p-transition);
}

/* Header Integration Styles */
.txt2pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--t2p-border);
}

.txt2pdf-logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.txt2pdf-logo-area i {
    font-size: 28px;
    color: var(--t2p-danger);
}

.txt2pdf-logo-area h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--t2p-text-main);
}

.txt2pdf-theme-toggle {
    background: var(--t2p-bg-card);
    border: 1px solid var(--t2p-border);
    color: var(--t2p-text-muted);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: var(--t2p-shadow-sm);
    transition: var(--t2p-transition);
}

.txt2pdf-theme-toggle:hover {
    color: var(--t2p-primary);
    border-color: var(--t2p-primary);
    transform: translateY(-2px);
}

/* Dashboard Cards */
.txt2pdf-card {
    background: var(--t2p-bg-card);
    border: 1px solid var(--t2p-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--t2p-shadow-md);
}

/* Responsive Panel Layout Systems */
.txt2pdf-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
}

@media (max-width: 900px) {
    .txt2pdf-grid {
        grid-template-columns: 1fr;
    }
}

/* Column Design Layout elements */
.txt2pdf-section-title {
    margin-bottom: 20px;
}

.txt2pdf-section-title h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--t2p-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.txt2pdf-section-title h3 i {
    color: var(--t2p-primary);
}

/* Custom CSS Controls, fields and textareas */
.txt2pdf-control-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.txt2pdf-control-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--t2p-text-main);
}

.txt2pdf-control-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--t2p-border);
    background-color: var(--t2p-bg-page);
    color: var(--t2p-text-main);
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: var(--t2p-transition);
}

.txt2pdf-control-group textarea:focus {
    border-color: var(--t2p-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Interactive Drag Drop File Upload */
.txt2pdf-file-upload-box {
    position: relative;
    border: 2px dashed var(--t2p-border);
    border-radius: 8px;
    background-color: var(--t2p-bg-page);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--t2p-transition);
}

.txt2pdf-file-upload-box:hover {
    border-color: var(--t2p-primary);
    background-color: rgba(59, 130, 246, 0.02);
}

.txt2pdf-file-upload-box input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.txt2pdf-upload-placeholder {
    pointer-events: none;
}

.txt2pdf-upload-placeholder i {
    font-size: 32px;
    color: var(--t2p-primary);
    margin-bottom: 10px;
}

.txt2pdf-upload-placeholder p {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 500;
}

.txt2pdf-upload-placeholder span {
    font-size: 12px;
    color: var(--t2p-text-muted);
}

/* Counters Stats and Button Triggers */
.txt2pdf-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.txt2pdf-stats {
    font-size: 13px;
    color: var(--t2p-text-muted);
    font-weight: 500;
}

.txt2pdf-stat-separator {
    margin: 0 6px;
    color: var(--t2p-border);
}

/* Buttons System Specifications */
.txt2pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--t2p-transition);
    border: 1px solid transparent;
    text-decoration: none;
}

.txt2pdf-btn-primary {
    background-color: var(--t2p-primary);
    color: #ffffff !important;
}

.txt2pdf-btn-primary:hover {
    background-color: var(--t2p-primary-hover);
    transform: translateY(-1px);
}

.txt2pdf-btn-outline {
    background-color: transparent;
    border-color: var(--t2p-border);
    color: var(--t2p-text-main) !important;
}

.txt2pdf-btn-outline:hover {
    background-color: var(--t2p-bg-page);
    border-color: var(--t2p-text-muted);
}

.txt2pdf-btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    width: 100%;
}

.txt2pdf-btn-text {
    background: transparent;
    color: var(--t2p-text-muted) !important;
}

.txt2pdf-btn-text:hover {
    color: var(--t2p-primary) !important;
}

/* Layout settings selectors form styles */
.txt2pdf-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.txt2pdf-settings-grid .full-width {
    grid-column: span 2;
}

.txt2pdf-settings-grid select,
.txt2pdf-settings-grid input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--t2p-border);
    background-color: var(--t2p-bg-page);
    color: var(--t2p-text-main);
    font-size: 14px;
    transition: var(--t2p-transition);
}

.txt2pdf-settings-grid select:focus,
.txt2pdf-settings-grid input:focus {
    border-color: var(--t2p-primary);
    outline: none;
}

/* Premium Styling Section */
.txt2pdf-premium-section {
    margin-top: 24px;
    border: 1px solid #fde047;
    background-color: #fef9c3;
    border-radius: 10px;
    overflow: hidden;
}

.txt2pdf-premium-header {
    background-color: #fef08a;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    color: #854d0e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.premium-badge {
    background-color: #ca8a04;
    color: #ffffff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 20px;
    text-transform: uppercase;
}

.txt2pdf-premium-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.premium-promo-text {
    font-size: 12px;
    color: #713f12;
    margin: 0 0 6px 0;
}

.premium-field-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.premium-checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #854d0e;
    cursor: pointer;
}

.premium-sub-input {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #fef08a;
    background-color: #ffffff;
    font-size: 12px;
    color: #713f12;
}

.premium-sub-input:disabled {
    opacity: 0.5;
    background-color: #fefdf0;
    cursor: not-allowed;
}

.premium-color-picker {
    border: 1px solid #fef08a;
    background: #ffffff;
    padding: 2px;
    border-radius: 6px;
    height: 30px;
    width: 60px;
    cursor: pointer;
}

.premium-color-picker:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.premium-promo-footer {
    border-top: 1px dashed #fde047;
    padding-top: 10px;
    font-size: 11px;
    color: #a16207;
    line-height: 1.4;
}

/* Live Preview Card styles */
.txt2pdf-preview-card {
    border-top: 4px solid var(--t2p-primary);
}

.txt2pdf-preview-canvas {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    min-height: 240px;
    max-height: 480px;
    overflow-y: auto;
    padding: 24px;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    color: #334155;
    white-space: pre-wrap;
    word-break: break-all;
    transition: var(--t2p-transition);
}

.preview-placeholder {
    color: var(--t2p-text-muted);
    font-style: italic;
    text-align: center;
    margin-top: 80px !important;
}

/* Notifications layout alerts */
.txt2pdf-notice {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notice-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--t2p-accent);
}

.notice-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--t2p-danger);
}

/* Modal Popup Window */
.txt2pdf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.txt2pdf-modal-content {
    background-color: var(--t2p-bg-card);
    border: 1px solid var(--t2p-border);
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 550px;
    box-shadow: var(--t2p-shadow-lg);
    animation: modalBounce 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalBounce {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-header h3 {
    margin: 0 0 20px 0;
    color: var(--t2p-accent);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
}

.success-stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.success-stats-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--t2p-border);
    font-size: 14px;
    color: var(--t2p-text-main);
}

.success-stats-table tr:last-child td {
    border-bottom: none;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

/* DARK MODE CONTRAST OVERRIDES */
.txt2pdf-wrapper.txt2pdf-dark-mode {
    --t2p-bg-page: #0f172a;
    --t2p-bg-card: #1e293b;
    --t2p-text-main: #f1f5f9;
    --t2p-text-muted: #94a3b8;
    --t2p-border: #334155;
    --t2p-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --t2p-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --t2p-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.txt2pdf-wrapper.txt2pdf-dark-mode .txt2pdf-preview-canvas {
    background-color: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

.txt2pdf-wrapper.txt2pdf-dark-mode .txt2pdf-premium-section {
    border-color: #854d0e;
    background-color: #422006;
}

.txt2pdf-wrapper.txt2pdf-dark-mode .txt2pdf-premium-header {
    background-color: #713f12;
    color: #fef08a;
}

.txt2pdf-wrapper.txt2pdf-dark-mode .premium-promo-text,
.txt2pdf-wrapper.txt2pdf-dark-mode .premium-checkbox-container,
.txt2pdf-wrapper.txt2pdf-dark-mode .premium-promo-footer {
    color: #fef08a;
}

.txt2pdf-wrapper.txt2pdf-dark-mode .premium-sub-input {
    border-color: #854d0e;
    background-color: #1e293b;
    color: #fefdf0;
}