/**
 * FOPT - Minimal Bootstrap-only stylesheet
 * All layout and components use Bootstrap utilities (5.3.3)
 * This file contains only essential custom styles not available via Bootstrap classes
 */

/* Font stack */
body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f8f9fa;
}

/* Main content area - account for fixed navbar (56px) */
main {
    min-height: calc(100vh - 56px);
}

/* Optional: subtle card shadows */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Bootstrap card-body default padding */
.card-body {
    padding: 1.5rem;
}

/* Form elements - ensure full width in Bootstrap grid */
label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

/* Table baseline styling */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    font-weight: 600;
    background-color: #f8f9fa;
}

/* Clickable table rows */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background-color: rgba(0, 0, 0, 0.025);
}

/* Toastr positioning */
#toast-container {
    top: 1rem;
    right: 1rem;
}

/* Utility list reset */
ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Grid for card layouts */
.fopt-grid {
    display: grid;
    gap: 1.5rem;
}

/* Responsive utilities */
@media (max-width: 576px) {
    body {
        font-size: 0.95rem;
    }
}

/* Admin dashboard card hover effects - CSP compliant */
.admin-card-hover {
    transition: all 0.2s;
}

.admin-card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Changelog Content Formatting */
.changelog-content {
    line-height: 1.8;
    max-width: 900px;
}

.changelog-content h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.changelog-content h3 {
    font-size: 1.5rem;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

.changelog-content h4 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
}

.changelog-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.changelog-content ul ul {
    margin-top: 0.5rem;
}

.changelog-content li {
    margin-bottom: 0.5rem;
}

.changelog-content code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #d63384;
}

.changelog-content a {
    color: #0d6efd;
    text-decoration: underline;
}

.changelog-content a:hover {
    color: #0a58ca;
}

.changelog-content p {
    margin-bottom: 1rem;
}

.changelog-content strong {
    font-weight: 600;
}

/* ========================================
   ADMIN SECTIONS
   ======================================== */

/* Admin Members - Danger Zone */
.danger-zone {
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 1rem;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

/* Admin Members - Actions Row */
.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (min-width: 769px) {
    .actions-row {
        display: flex;
        flex-direction: row;
    }

    .actions-row .btn {
        flex: 0 0 auto;
    }
}

/* Admin Members - Tag List */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tag {
    background: #d9e2ec;
    color: #102a43;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.85rem;
}

/* Admin Members - Modal Styles */
.member-modal-backdrop,
.delete-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 42, 67, 0.55);
    z-index: 9000;
    display: none;
}

.member-modal-backdrop.open,
.delete-modal-backdrop.open {
    display: block;
}

.member-modal,
.delete-modal {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.member-modal.open,
.delete-modal.open {
    display: flex;
}

.modal-card {
    width: min(560px, 100%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(16, 42, 67, 0.3);
    padding: 1.25rem;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.modal-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #334e68;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover,
.modal-close:focus {
    color: #102a43;
}

/* Input Row (2-column form layout) */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 576px) {
    .input-row {
        grid-template-columns: 1fr;
    }
}

/* Hint text styling */
.hint {
    color: #52606d;
    font-size: 0.9rem;
    margin-top: -0.35rem;
    margin-bottom: 0.7rem;
}

/* Clickable row cursor */
.cursor-pointer {
    cursor: pointer;
}

/* Responsive Card Actions */
.responsive-card-actions {
    display: grid;
    gap: 0.5rem;
}

/* ========================================
   UPDATE ADMIN SECTIONS
   ======================================== */

/* Large success icon */
.icon-xl {
    font-size: 3rem;
}

/* Table column width for update tables */
.update-table-label-col {
    width: 40%;
}

/* Scrollable file list container */
.file-list-scroll {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.875rem;
}

/* 2-spaltig bei großen Bildschirmen (Desktop) - nur für Mitglieder-Tabelle */
@media (min-width: 992px) {
    #members-table-body .responsive-card-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .actions-row .btn {
        width: 100%;
    }

    .responsive-card-actions {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding-top: 0.35rem;
    }
}

/* Responsive Card Table */
.responsive-card-table {
    width: 100%;
}

@media (max-width: 768px) {
    .responsive-card-table thead {
        display: none;
    }

    .responsive-card-table,
    .responsive-card-table tbody,
    .responsive-card-table tr,
    .responsive-card-table td {
        display: block;
        width: 100%;
    }

    .responsive-card-table tr {
        border: 1px solid #d9e2ec;
        border-radius: 10px;
        padding: 0.75rem;
        margin-bottom: 0.85rem;
        background: #fff;
    }

    .responsive-card-table td {
        border: 0;
        padding: 0.35rem 0;
    }

    .responsive-card-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #52606d;
        margin-bottom: 0.2rem;
    }

    .responsive-card-table td:last-child {
        padding-top: 0.6rem;
        border-top: 1px solid #e4e7eb;
        margin-top: 0.35rem;
    }
}

/* ========================================
   HOME PAGE
   ======================================== */

/* Home - Accent Borders */
.accent-left {
    border-left: 5px solid !important;
}

.accent-primary {
    border-left-color: #0d6efd !important;
}

.accent-success {
    border-left-color: #198754 !important;
}

.accent-danger {
    border-left-color: #dc3545 !important;
}

.accent-warning {
    border-left-color: #ffc107 !important;
}

.accent-info {
    border-left-color: #0dcaf0 !important;
}

.accent-secondary {
    border-left-color: #6c757d !important;
}

/* Header actions on list/dashboard pages */
@media (max-width: 767.98px) {

    .home-header-actions,
    .news-header-actions,
    .events-header-actions,
    .projects-header-actions,
    .notifications-header-actions {
        width: 100%;
    }

    .home-header-actions .btn,
    .news-header-actions .btn,
    .events-header-actions .btn,
    .projects-header-actions .btn,
    .notifications-header-actions .btn,
    .events-header-actions .btn-group {
        width: 100%;
    }
}

@media (min-width: 768px) {

    .home-header-actions .btn,
    .news-header-actions .btn,
    .events-header-actions .btn,
    .projects-header-actions .btn,
    .notifications-header-actions .btn,
    .events-header-actions .btn-group {
        width: auto;
    }
}

@media (max-width: 767.98px) {

    .profile-security-actions .btn,
    .profile-privacy-actions .btn,
    .profile-privacy-link,
    .profile-consent-action {
        width: 100%;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }
}

@media (min-width: 768px) {

    .profile-security-actions .btn,
    .profile-privacy-actions .btn,
    .profile-privacy-link,
    .profile-consent-action {
        width: auto;
    }
}

/* ========================================
   NEWS SECTION
   ======================================== */

/* News Index - Hover Lift Effect */
.hover-lift {
    transition: transform 0.2s, box-shadow 0.2s;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* News Detail - Article Content */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 0.5rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* News Detail - Layout tuning (Bootstrap-first, custom polish) */
.news-detail-title {
    font-size: clamp(2rem, 4.5vw, 3.35rem);
    line-height: 1.15;
}

.news-detail-actions .btn {
    min-width: 9.5rem;
}

.news-detail-meta .meta-item strong {
    display: block;
}

.news-detail-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.news-detail-author-icon {
    font-size: 6rem;
    line-height: 1;
    color: #dee2e6;
}

@media (min-width: 1200px) {
    .news-detail-sidebar-sticky {
        position: sticky;
        top: 5rem;
    }
}

@media (max-width: 768px) {

    .news-detail-actions .btn,
    .news-detail-actions form {
        width: 100%;
    }

    .news-detail-meta .meta-item {
        text-align: left !important;
    }

    .article-content {
        font-size: 1rem;
        line-height: 1.7;
    }
}

@media (max-width: 576px) {
    .news-detail-title {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
    }
}

/* ========================================
   CSP-COMPLIANT UTILITY CLASSES
   Replaces inline styles for Content Security Policy compliance
   ======================================== */

/* Icon sizes */
.icon-xl {
    font-size: 2rem;
    line-height: 1;
}

.icon-lg {
    font-size: 1.5rem;
}

.icon-xxl {
    font-size: 3rem;
}

/* Text sizes */
.text-xs {
    font-size: 0.875rem;
}

.text-sm {
    font-size: 0.9rem;
}

/* Auth page centering */
.auth-container {
    min-height: calc(100vh - 56px);
}

.auth-card {
    max-width: 400px;
}

.auth-card-wide {
    max-width: 500px;
}

/* Event/Map heights */
.map-full {
    height: 400px;
}

.map-preview {
    height: 300px;
}

/* Document viewer iframe */
.document-viewer-body {
    min-height: 500px;
}

.document-viewer-iframe {
    width: 100%;
    height: 70vh;
    border: none;
}

/* Scrollable content boxes */
.scroll-box {
    max-height: 150px;
    overflow-y: auto;
}

/* Image constraints */
.img-constrained {
    max-width: 150px;
}

.img-constrained-md {
    max-width: 200px;
}

.img-constrained-lg {
    max-width: 300px;
}

.img-constrained-vita {
    max-width: 350px;
}

.img-constrained-qr {
    max-width: 200px;
}

.img-profile {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

.img-profile-lg {
    width: 200px;
    height: 200px;
    object-fit: cover;
}

.img-vita-photo {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.img-avatar-sm {
    width: 40px;
    height: 40px;
}

.img-avatar-sm-cover {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

/* Badge circles for step numbers */
.badge-circle {
    width: 30px;
    height: 30px;
    line-height: 18px;
}

.badge-circle-lg {
    width: 50px;
    height: 50px;
}

.badge-notification {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
}

/* Gallery images */
.img-gallery-preview {
    height: 200px;
    object-fit: contain;
    background-color: var(--bs-secondary-bg);
}

.img-gallery-thumb {
    height: 250px;
    object-fit: contain;
    background-color: var(--bs-secondary-bg);
    cursor: pointer;
}

.img-gallery-modal {
    max-height: 300px;
    max-width: 100%;
    object-fit: contain;
    background-color: var(--bs-secondary-bg);
}

.img-upload-preview {
    max-height: 400px;
    width: 100%;
    object-fit: contain;
}

.img-voting {
    height: 250px;
    object-fit: contain;
    background-color: var(--bs-secondary-bg);
    cursor: pointer;
}

/* Responsive Anpassung für mobile Geräte - nur im Voting-Kontext */
@media (max-width: 576px) {
    #voting .img-voting,
    [role="tabpanel"][id="voting"] .img-voting {
        height: 180px;
        width: 100%;
    }
}

/* Table column widths - using existing pattern */
.col-xs {
    width: 40px;
}

.col-xxs {
    width: 50px;
}

.col-sm {
    width: 80px;
}

.col-md {
    width: 120px;
}

.col-lg {
    width: 150px;
}

.col-xl {
    width: 300px;
}

/* Fixed pixel widths for table columns (Bootstrap utility style) */
.w-px-40 {
    width: 40px;
}

.w-px-80 {
    width: 80px;
}

.w-px-100 {
    width: 100px;
}

.w-px-120 {
    width: 120px;
}

.w-px-150 {
    width: 150px;
}

/* Logo aperture spacing */
.logo-aperture {
    margin: 0 2px;
}

/* Max width truncate for text */
.max-w-150 {
    max-width: 150px;
}

.max-w-120 {
    max-width: 120px;
}

/* Icon sizes - extend existing */
/* .icon-xl ist bereits in Zeile 591 definiert */

.icon-xxl {
    font-size: 3rem;
}

.icon-xxxl {
    font-size: 4rem;
}

.icon-huge {
    font-size: 8rem;
}

/* Voting/Gallery image heights */
/* .img-voting ist bereits in Zeile 748 definiert */
/* .img-gallery-preview und .img-gallery-thumb sind bereits in Zeile 728-738 definiert */

/* Progress bar custom heights */
.progress-lg {
    height: 24px;
}

.progress-md {
    height: 25px;
}

/* Cropper container */
.cropper-wrapper {
    max-height: 500px;
    min-height: 300px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scrollable sections with defined heights */
.scroll-md {
    max-height: 300px;
    overflow-y: auto;
}

.scroll-lg {
    max-height: 400px;
    overflow-y: auto;
}

.scroll-sm {
    max-height: 200px;
    overflow-y: auto;
}

.scroll-xl {
    max-height: 600px;
    overflow-y: auto;
}

/* Modal widths */
.modal-wide {
    max-width: 900px;
}

.modal-standard {
    max-width: 560px;
}

/* Table column widths */
/* .col-xs, .col-sm, .col-md, .col-lg, .col-xl sind bereits in Zeile 764-784 definiert */

/* ========================================
   DOCUMENT/IMAGE VIEWER IFRAME STYLES
   ======================================== */

/* Iframe viewer styling for document/image preview */
.viewer-body-image {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f5f5f5;
}

.viewer-body-image img {
    max-width: 100%;
    max-height: 100vh;
}

/* ========================================
   VITA DISPLAY
   ======================================== */

/* Vita photo display */
.vita-photo {
    max-width: 150px;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Vita field labels - fixed width for alignment */
.vita-label {
    min-width: 120px;
    flex-shrink: 0;
}

/* Mobile: stack labels and values, reduce label width */
@media (max-width: 576px) {
    .vita-label {
        min-width: 100px;
        font-size: 0.9rem;
    }
    
    .vita-photo {
        max-width: 120px;
    }
}

/* ========================================
   TABLE COLUMN WIDTHS
   ======================================== */

/* Fixed width table headers */
.th-w-50 {
    width: 50px;
}

.th-w-100 {
    width: 100px;
}

.th-w-150 {
    width: 150px;
}

.viewer-body-message {
    margin: 0;
    padding: 2rem;
    font-family: system-ui, -apple-system, sans-serif;
}

.viewer-message-content {
    text-align: center;
}

.viewer-message-content h3 {
    margin-top: 0;
}

/* Sticky table header */
.table-sticky-header thead {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}

/* Scrollable table container */
.table-scroll {
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* Monospace table for logs */
.table-monospace {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Card minimum heights (admin dashboard) */
.card-min-h-lg {
    min-height: 160px;
}

.card-min-h-md {
    min-height: 20px;
}

/* Cursor pointer */
.cursor-pointer {
    cursor: pointer;
}

/* Logo aperture margin */
.logo-aperture {
    margin: 0 2px;
}

/* Pre-wrap whitespace */
.ws-pre-wrap {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Max height utilities */
.mh-600 {
    max-height: 600px;
    overflow-y: auto;
}

/* Progress bar height */
.progress-sm {
    height: 8px;
}

/* ========================================
   AUTHENTICATION PAGES
   ======================================== */

/* Password Requirements Indicator */
.password-requirement {
    font-size: 0.875rem;
    color: #6c757d;
}

.password-requirement.met {
    color: #198754;
}

.password-requirement.met i {
    color: #198754;
}

.password-requirement i {
    width: 20px;
}

/* ========================================
   MAINTENANCE & SPECIAL PAGES
   ======================================== */

/* Maintenance Page */
.maintenance-page-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maintenance-container {
    max-width: 600px;
    padding: 2rem;
}

.maintenance-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.maintenance-icon {
    font-size: 4rem;
    color: #667eea;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.dark-mode-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
}

/* Force Password Change Page */
.password-change-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-change-card {
    max-width: 500px;
    width: 100%;
}

/* ========================================
   ADMIN DEBUG PAGE
   ======================================== */

/* Debug page - color overrides for log entries */
.bg-dark .text-danger {
    color: #ff6b6b !important;
}

.bg-dark .text-warning {
    color: #ffd43b !important;
}

.bg-dark .text-info {
    color: #74c0fc !important;
}

.bg-dark .text-success {
    color: #51cf66 !important;
}

.bg-dark .text-muted {
    color: #868e96 !important;
}

/* Debug page - table label width */
.debug-label-width {
    width: 30%;
}

/* Debug page - log containers */
.log-container-migrations,
.log-container-entries {
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.log-container-migrations {
    max-height: 400px;
}

.log-container-entries {
    max-height: 600px;
}