/* ============================================================================
   Global Styles
   ============================================================================ */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

html {
    overflow-y: scroll;  /* Always show scrollbar to prevent reflow when content exceeds viewport */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

main {
    flex: 1;  /* Fills available space, pushing footer to bottom */
}

/* ============================================================================
   Layout
   ============================================================================ */

.container {
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-rows: auto auto;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

.header {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.title-text h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.title-text p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.main-content {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.sidebar {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================================================
   Steps
   ============================================================================ */

.step {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: none !important;  /* Hidden by default - force with !important */
    transition: all 0.3s ease;
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
}

.step.active {
    display: block !important;  /* Show when active - force with !important */
}

.step h2 {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    color: var(--text-dark);
    font-size: 1.5rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.1rem;
}

.step.active .step-number {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.1);
}

/* ============================================================================
   Upload Area
   ============================================================================ */

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--bg-light);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.upload-icon {
    width: 60px;
    height: 60px;
    fill: var(--primary-color);
    margin-bottom: 15px;
    opacity: 0.8;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ============================================================================
   File Info
   ============================================================================ */

.upload-info {
    margin-top: 25px;
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--success-color);
}

.file-info {
    margin-bottom: 15px;
}

.info-item {
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.info-item strong {
    color: var(--text-dark);
    display: inline-block;
    width: 100px;
}

.info-item span {
    color: var(--text-light);
}

.info-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

/* ============================================================================
   Options Grid
   ============================================================================ */

.settings-info {
    background: linear-gradient(135deg, #f5f9ff 0%, #f0f8ff 100%);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.settings-info p {
    margin: 0 0 15px 0;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.settings-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-info li {
    padding: 10px 0;
    color: var(--text-color);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-info li strong {
    color: var(--text-dark);
    min-width: 150px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.option-group input[type="text"],
.option-group input[type="number"],
.option-group select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: var(--bg-white);
    color: var(--text-dark);
    transition: border-color 0.3s ease;
}

.option-group input[type="text"]:focus,
.option-group input[type="number"]:focus,
.option-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.option-group small {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 3px;
}

/* Checkbox style */
.option-group.checkbox {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

.option-group.checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}

.option-group.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.85rem;
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-small:hover {
    background-color: var(--border-color);
    border-color: var(--primary-color);
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: flex-start;
}

/* ============================================================================
   Preview
   ============================================================================ */

.preview-container {
    background-color: var(--bg-light);
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 600px;
    max-height: 600px;
    min-height: 600px;
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    overflow: hidden !important;  /* Force overflow hidden to prevent expansion */
}

.preview-container > * {
    box-sizing: border-box;
    flex-shrink: 1;
}

.preview-container .preview-output {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    margin: 0;
    box-sizing: border-box;
}

.preview-header h3 {
    margin: 0;
    color: var(--text-dark);
}

.preview-actions {
    display: flex;
    gap: 10px;
}

.preview-output {
    padding: 20px;
    background-color: #1e293b;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    flex: 1;
    min-height: 0;  /* Critical: allows flex child to be smaller than content */
    max-height: 100%;  /* Prevent expansion */
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0 !important;  /* Override any default margins */
}

/* ============================================================================
   Sidebar
   ============================================================================ */

.help-section,
.examples-section,
.tips-section {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.help-section h3,
.examples-section h3,
.tips-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

details {
    margin-bottom: 12px;
    cursor: pointer;
}

details summary {
    font-weight: 600;
    color: var(--primary-color);
    padding: 8px 0;
    user-select: none;
}

details summary:hover {
    text-decoration: underline;
}

details p {
    margin-top: 10px;
    padding: 10px;
    background-color: var(--bg-light);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.tips-section ul {
    list-style: none;
    padding: 0;
}

.tips-section li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-light);
    font-size: 0.9rem;
}

.tips-section li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.examples-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.example-item {
    padding: 10px;
    background-color: var(--bg-light);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.example-item:hover {
    background-color: #e0e7ff;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================================================
   Status Messages
   ============================================================================ */

.status-message {
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-weight: 500;
}

.status-message.success {
    background-color: #d1fae5;
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

.status-message.error {
    background-color: #fee2e2;
    border-left: 4px solid var(--danger-color);
    color: #7f1d1d;
}

.status-message.warning {
    background-color: #fef3c7;
    border-left: 4px solid var(--warning-color);
    color: #78350f;
}

.status-message.info {
    background-color: #dbeafe;
    border-left: 4px solid var(--primary-color);
    color: #1e40af;
}

/* ============================================================================
   Loading Overlay
   ============================================================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-text {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 15px;
    }

    .sidebar {
        grid-column: 1;
        grid-row: auto;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .info-row {
        grid-template-columns: 1fr;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
        gap: 10px;
    }

    .header {
        padding: 30px 15px;
        margin-bottom: 15px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header p {
        font-size: 0.95rem;
    }

    .step {
        padding: 20px;
    }

    .step h2 {
        font-size: 1.2rem;
        gap: 10px;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 0.95rem;
    }

    .upload-area {
        padding: 40px 15px;
    }

    .upload-icon {
        width: 45px;
        height: 45px;
    }

    .upload-text {
        font-size: 0.95rem;
    }

    .preview-output {
        max-height: 300px;
        font-size: 0.85rem;
        padding: 15px;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
        gap: 8px;
    }

    .header h1 {
        font-size: 1.3rem;
    }

    .step {
        padding: 15px;
    }

    .step h2 {
        font-size: 1.1rem;
    }

    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .preview-actions {
        width: 100%;
    }

    .preview-actions .btn {
        flex: 1;
    }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    .sidebar,
    .button-group,
    .help-section,
    .examples-section,
    .tips-section {
        display: none;
    }

    .header {
        margin-bottom: 10px;
    }

    .step {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* ============================================================================
   Mode Selector & Jianpu Conversion Styles
   ============================================================================ */

.mode-selector {
    grid-column: 1 / -1;
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.mode-selector h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.mode-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mode-btn {
    flex: 1;
    min-width: 180px;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
}

.jianpu-input-section {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.jianpu-textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    resize: vertical;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: border-color 0.3s ease;
}

.jianpu-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.jianpu-textarea::placeholder {
    color: var(--text-light);
}

.jianpu-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-end;
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
}

/* ============================================================================
   Font Rendering Styles
   ============================================================================ */

@font-face {
    font-family: 'Jianpu ASCII';
    src: local('Jianpu ASCII'), url('https://github.com/RobertWinslow/jianpu-ascii-font/raw/master/jianpu-ascii.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

.font-selector {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.3s ease;
    min-width: 180px;
    display: none;
}

.font-selector:hover {
    border-color: var(--primary-color);
}

.font-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.font-rendering-container {
    background: var(--bg-white);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    flex: 1;
    min-height: 700px;
    max-height: 100%;  /* Prevent expansion */
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    line-height: 1.6;
    margin: 0 !important;  /* Override any default margins */
    box-sizing: border-box;
}

.font-rendering-container > * {
    box-sizing: border-box;
}

.font-rendering-container.with-content {
    border-style: solid;
    align-items: stretch;
    justify-content: flex-start;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 15px;
    overflow-y: auto;
}

.metadata-section {
    margin-bottom: 30px;
    border-bottom: 2px solid #ccc;
    padding-bottom: 30px;
    min-height: 200px;
    overflow-y: auto;
}

.font-rendering-jianpu-ascii {
    font-family: 'Jianpu ASCII', monospace;
    font-size: 16px;
    letter-spacing: 0px;
}

.font-rendering-jianpu-ascii > * {
    max-height: 100%;
    overflow: inherit;
    box-sizing: border-box;
    margin: 0;
    flex-shrink: 1;
}

.font-rendering-jianpu-ascii pre {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    max-height: 100%;
    width: 100%;
}

.font-info {
    display: none;
}

/* ============================================================================
   SVG Visualizer Styles
   ============================================================================ */

.svg-visualizer-container {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.svg-visualizer-container svg {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
}

.svg-visualizer-container p {
    color: #999;
    text-align: center;
    padding: 40px;
    font-size: 14px;
}

/* ============================================================================
   Legal Policies Section
   ============================================================================ */

.legal-policies-section {
    background: var(--bg-white);
    padding: 40px 20px;
    margin: 40px 0;
    border-top: 2px solid var(--border-color);
}

.legal-policies-section .container {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
}

.policies-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-color);
}

.policy-tab {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    bottom: -2px;
}

.policy-tab:hover {
    color: var(--primary-color);
}

.policy-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.policy-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.policy-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.policy-content h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    margin-top: 0;
}

.policy-content h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-top: 25px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

.policy-content h4 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-top: 15px;
    margin-bottom: 10px;
    font-weight: 600;
}

.policy-content p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.policy-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
    color: var(--text-light);
    line-height: 1.8;
}

.policy-content li {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.policy-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.policy-content th,
.policy-content td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
    color: var(--text-light);
    font-size: 0.9rem;
}

.policy-content th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

/* ============================================================================
   Footer
   ============================================================================ */

.footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    padding: 50px 20px;
    margin-top: 50px;
    border-top: 2px solid var(--border-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 1.1rem;
    color: #f1f5f9;
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 12px;
}

.footer-section a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.footer-section a:hover {
    color: #f1f5f9;
    text-decoration: underline;
    transform: translateX(5px);
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.footer-logo img {
    height: 50px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-logo:hover img {
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-bottom p {
    margin: 0;
    line-height: 1.6;
}

.footer-bottom a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: #f1f5f9;
    text-decoration: underline;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer {
        padding: 30px 15px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-logo {
        order: -1;
        margin-top: 0;
        margin-bottom: 20px;
    }

    .footer-section h4 {
        font-size: 1rem;
    }

    .footer-section a {
        font-size: 0.9rem;
    }

    .footer-bottom {
        padding-top: 20px;
        font-size: 0.85rem;
    }
}

/* ============================================================================
   Policy Modal Styles
   ============================================================================ */

.policy-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.policy-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.policy-modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.policy-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-light);
    border-radius: 8px 8px 0 0;
}

.policy-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-dark);
    flex: 1;
}

.policy-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.policy-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

.policy-modal-close:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.policy-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.policy-modal-body h3 {
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.policy-modal-body h3:first-child {
    margin-top: 0;
}

.policy-modal-body h4 {
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--text-dark);
}

.policy-modal-body p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text-dark);
}

.policy-modal-body ul,
.policy-modal-body ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.policy-modal-body li {
    margin-bottom: 8px;
    color: var(--text-dark);
}

.policy-modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.policy-modal-body th,
.policy-modal-body td {
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: left;
}

.policy-modal-body th {
    background-color: var(--bg-light);
    font-weight: 600;
}

.policy-modal-body tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.policy-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-light);
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-close-btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.modal-close-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.modal-close-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Scrollbar styling for policy modal body */
.policy-modal-body::-webkit-scrollbar {
    width: 8px;
}

.policy-modal-body::-webkit-scrollbar-track {
    background: var(--bg-light);
}

.policy-modal-body::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.policy-modal-body::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .policy-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .policy-modal-header {
        padding: 16px;
    }

    .policy-modal-header h2 {
        font-size: 1.25rem;
    }

    .policy-modal-body {
        padding: 16px;
        font-size: 0.95rem;
    }

    .policy-modal-header,
    .policy-modal-footer {
        padding: 12px 16px;
    }
}