/* OWASP Security: Enhanced protection against content overflow */
.page-header {
    display: none;
}

.theme-card {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
}

/* OWASP Security: Enhanced clickjacking protection */
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: 2px solid rgba(0, 123, 255, 0.5);
    outline-offset: 2px;
}
#customColorsForm .input-group .form-control {
    font-size: 1rem;
}
/* OWASP Security: Enhanced color scheme overflow protection */
.color-scheme {
    max-width: 100%;
    overflow: hidden;
    border-radius: 4px;
}

/* OWASP Security: Enhanced text overflow protection */
.form-check-label {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

/* OWASP Security: Additional input protection */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea,
select {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* OWASP Security: Focus states for accessibility */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* OWASP Security: Error message styling */
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    border-radius: 4px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

/* OWASP Security: Loading state protection */
.loading {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.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 #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* OWASP Security: Disabled state protection */
input:disabled,
button:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* OWASP Security: Hidden element protection */
[hidden],
.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.theme-step {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.theme-step .step {
    flex: 1 1 20%;
    min-width: 180px;
    text-align: left;
    font-weight: 500;
    color: #222;
    border-bottom: 1px solid #eaeaea;
    border-top: 2px solid #eaeaea;
    padding: 1rem 20px 0.5rem 20px;
}
.theme-step .step .icon {
    color:#2F9915;
}
.theme-step .step.active {
    color: #212d13;
    border-top: 2px solid #212d13;
}
.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}
.theme-card {
    border: 2px solid #eaeaea;
    border-radius: 16px;
    background: #fff;
    transition: border-color 0.2s;
    position: relative;
}
.theme-card.selected {
    border-color: #212d13;
    box-shadow: 0 0 0 2px #212d13;
}
.theme-card img {
    width: 100%;
    margin-bottom: 1rem;
    border-bottom: 2px solid #eaeaea;
    border-radius: 14px 14px 0 0;
}
.theme-desc-block {
    padding: 1rem;
}
.theme-desc-block .form-check-label {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
}
.theme-desc-block .form-check .form-check-input {
    margin-top: 4px;
    border: 4px solid;
}
.theme-card .theme-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
}
.theme-card .theme-preview {
    font-size: 1rem;
    color: #4b5563;
    text-decoration: underline;
    cursor: pointer;
    margin-bottom: 0.5rem;
    display: inline-block;
}
.theme-card .theme-desc {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.color-scheme-block .form-check-label {
    margin-top: -2px;
    margin-bottom: -2px;
}
.color-scheme {
    width: 24px;
    height: 24px;
    border: 1px solid #eaeaea;
    margin-right: 3px;
}
.color-scheme-block {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}
.color-select {
    border: 1px solid #273b09;
}
.manage-sections .row .col-auto .form-check {
    padding-left: 0;
}
.manage-sections::-webkit-scrollbar {
    width: 6px;
}

.manage-sections::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.manage-sections::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.manage-sections::-webkit-scrollbar-thumb:hover {
    background: #555;
}
@media (max-width: 900px) {
    .theme-grid { grid-template-columns: 1fr; }
}

section {
    margin: 20px 0;
    padding: 20px 0;
}

.mr-5 {
    margin-right: 5px;
}
.theme-edit-col.border-end {
    padding-right: 2rem;
}
.preview-col {
    padding-left: 2rem;
}
.color-schemes-block {
    width: 90%;
}
.landing-page-footer {
    border-top: 1px solid #eaeaea;
    padding: 20px;
}
.landing-page-footer .btn {
    width: 150px;
    border-radius: 10px;
}
.theme-edit-col {
    position: relative;
}

/* Preview Mode Toggle Styles */
.preview-mode-toggle {
    width: 100%;
}

.toggle-container {
    display: flex;
    background: var(--tblr-bg-surface, #f8f9fa);
    border: 1px solid var(--tblr-border-color, #dee2e6);
    border-radius: 8px;
    padding: 2px;
    position: relative;
}

.toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    color: var(--tblr-body-color, #495057);
    background: transparent;
    border: none;
    position: relative;
    z-index: 2;
}

.toggle-label:hover {
    background: var(--tblr-bg-surface-hover, rgba(0, 0, 0, 0.04));
}

.toggle-icon {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.toggle-text {
    white-space: nowrap;
}

/* Active state styles - clear and simple */
.toggle-input:checked + .toggle-label {
    background: var(--tblr-primary, #206bc4);
    color: white;
    font-weight: 600;
}

.toggle-input:checked + .toggle-label .toggle-icon {
    opacity: 1;
    color: white;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .toggle-container {
        background: var(--tblr-bg-surface-dark, #1e1e1e);
        border-color: var(--tblr-border-color-dark, #2d2d2d);
    }

    .toggle-label {
        color: var(--tblr-body-color-dark, #e1e1e1);
    }

    .toggle-label:hover {
        background: var(--tblr-bg-surface-hover-dark, rgba(255, 255, 255, 0.04));
    }
}

/* Tabler dark mode class support */
[data-bs-theme="dark"] .toggle-container {
    background: var(--tblr-bg-surface-dark, #1e1e1e);
    border-color: var(--tblr-border-color-dark, #2d2d2d);
}

[data-bs-theme="dark"] .toggle-label {
    color: var(--tblr-body-color-dark, #e1e1e1);
}

[data-bs-theme="dark"] .toggle-label:hover {
    background: var(--tblr-bg-surface-hover-dark, rgba(255, 255, 255, 0.04));
}

/* Focus states for accessibility */
.toggle-input:focus + .toggle-label {
    outline: 2px solid var(--tblr-primary, #206bc4);
    outline-offset: 2px;
}

/* Responsive design */
@media (max-width: 768px) {
    .toggle-label {
        padding: 10px 12px;
        font-size: 13px;
        gap: 6px;
    }

    .toggle-icon {
        width: 14px;
        height: 14px;
    }
}

/* Prevent FOUC (Flash of Unstyled Content) */
.preview-card {
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 5px;
}

.preview-card.loaded {
    opacity: 1;
}

/* Ensure fonts are loaded before showing content */
.lp-template {
    font-display: swap;
}

/* Loading state for theme application */
.theme-loading {
    position: relative;
}

.theme-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}



/* Ensure labels are above the background */
.toggle-label {
    z-index: 2;
}

/* OWASP Security: Additional security measures */

/* Prevent text selection on sensitive elements */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent drag and drop on sensitive elements */
.no-drag {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* Secure iframe protection */
iframe {
    max-width: 100%;
    border: none;
    overflow: hidden;
}

/* Prevent content overflow in all containers */
* {
    box-sizing: border-box;
}

/* Secure button states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Prevent form submission on enter key for sensitive forms */
.prevent-enter-submit input {
    pointer-events: auto;
}

/* Secure modal protection */
.modal {
    z-index: 1050;
}

.modal-backdrop {
    z-index: 1040;
}

/* Prevent right-click context menu on sensitive elements */
.no-context-menu {
    -webkit-context-menu: none;
    -moz-context-menu: none;
    -ms-context-menu: none;
    context-menu: none;
}

/* Secure scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Print protection */
@media print {
    .no-print {
        display: none !important;
    }

    .preview-card {
        opacity: 1 !important;
    }
}

/* High contrast mode support for accessibility */
@media (prefers-contrast: high) {
    .form-check-input:focus {
        outline: 3px solid #000;
        outline-offset: 2px;
    }

    .btn:focus {
        outline: 3px solid #000;
        outline-offset: 2px;
    }
}

/* Reduced motion support for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .loading::after {
        animation: none;
    }
}


