﻿/* ============================================================
   findforcesconfig-form.css
   Shared styles for FindForcesDBNew, FindForcesDBEdit,
   and FindForcesDBCopy components.
   ============================================================ */

/* ---------- Home / Back button ---------- */
.home-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #e74c3c;
    color: white;
    padding: 0.7rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    .home-button:hover {
        background-color: #c0392b;
        color: white;
        text-decoration: none;
    }

/* ---------- Status notifications (Edit + Copy modes) ---------- */
.edit-status-notification {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #fcf5f4;
    border: 1px solid #f2d4d1;
    border-left: 4px solid #e74c3c;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

    .edit-status-notification i {
        margin-right: 8px;
        color: #e74c3c;
    }

.copy-status-notification {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

    .copy-status-notification i {
        margin-right: 8px;
        color: #2196f3;
    }

/* ---------- Configuration Status Panel ---------- */
.config-status-panel {
    background: white;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #ddd;
    transition: all 0.3s ease;
}

.status-header {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    gap: 1rem;
}

.status-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.status-content {
    flex: 1;
}

.status-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    letter-spacing: 0.2px;
}

.status-message {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.4;
}

.match-count {
    text-align: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    min-width: 80px;
}

.count-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.count-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.count-icon {
    display: block;
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

/* Status badges container (Copy mode) */
.status-badges {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

/* ---------- Status variants ---------- */
.status-ready {
    border-left-color: #6c757d;
}

    .status-ready .status-icon {
        background-color: #f8f9fa;
        color: #6c757d;
    }

    .status-ready .status-title {
        color: #495057;
    }

.status-unique {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

    .status-unique .status-icon {
        background-color: #28a745;
        color: white;
    }

    .status-unique .status-title {
        color: #155724;
    }

    .status-unique .status-message {
        color: #155724;
    }

.status-duplicate {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fffdf7 0%, #fff8e1 100%);
}

    .status-duplicate .status-icon {
        background-color: #ffc107;
        color: #856404;
    }

    .status-duplicate .status-title {
        color: #856404;
    }

    .status-duplicate .status-message {
        color: #856404;
    }

    .status-duplicate .match-count {
        background-color: #fff3cd;
        border: 1px solid #ffeaa7;
        color: #856404;
    }

/* Status error (Copy mode when no changes detected) */
.status-error {
    border-left-color: #f44336;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

    .status-error .status-icon {
        background-color: #f44336;
        color: white;
    }

    .status-error .status-title {
        color: #c62828;
    }

    .status-error .status-message {
        color: #c62828;
    }

/* Match-count modifiers (Copy mode) */
.match-count.warning {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
}

    .match-count.warning .count-icon {
        font-size: 1.3em;
    }

    .match-count.warning .count-label {
        font-weight: 600;
    }

.match-count.original-match {
    background-color: #e3f2fd;
    border: 2px solid #2196f3;
    color: #1565c0;
}

    .match-count.original-match .count-icon {
        font-size: 1.3em;
    }

    .match-count.original-match .count-label {
        font-weight: 600;
    }

/* ---------- Smart dropdowns ---------- */
.editable-dropdown {
    position: relative;
}

.custom-dropdown {
    position: absolute;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ccc;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    margin-top: 1px;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

    .dropdown-item:hover {
        background-color: #f8f9fa;
    }

    .dropdown-item.highlight {
        background-color: rgba(231, 76, 60, 0.1);
        border-left: 3px solid #e74c3c;
        font-weight: 500;
    }

    .dropdown-item:last-child {
        border-bottom: none;
    }

/* ---------- Page container ---------- */
.page-container {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 80px;
}

.search-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ---------- Card / section styles (engineering theme) ---------- */
.search-section, .bottom-filters, .results-section,
.information-section, .result-corner-forces,
.anchor-forces-section, .top-climbing-section,
.reference-section, .metadata-section {
    border: none;
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 32, 0.1);
    background-color: #f9f5f5;
    margin-bottom: 2rem;
    padding: 1.75rem;
    position: relative;
}

    .search-section:before,
    .bottom-filters:before,
    .results-section:before,
    .information-section:before,
    .result-corner-forces:before,
    .anchor-forces-section:before,
    .top-climbing-section:before,
    .reference-section:before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 4px;
        background: linear-gradient(90deg, #c0392b, #e74c3c, #c0392b);
    }

/* ---------- Section headers ---------- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e1e5eb;
}

    .section-header h4, .section-header h5 {
        margin: 0;
        color: #2c3e50;
        font-weight: 600;
    }

    .section-header h4 {
        font-size: 1.1rem;
    }

    .section-header h5 {
        font-size: 0.95rem;
        text-align: left;
        color: #7f8c8d;
        letter-spacing: 0.5px;
    }

/* ---------- Form layout ---------- */
.form-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
}

    .form-group label {
        display: block;
        font-weight: 500;
        color: #34495e;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }

.form-control, .form-select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #dce4ec;
    border-radius: 4px;
    background-color: #fcf8f8;
    color: #2c3e50;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

    .form-control[readonly] {
        background-color: #f7f5f5;
        cursor: default;
    }

    .form-control:focus, .form-select:focus {
        border-color: #e74c3c;
        box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.25);
        background-color: #fff;
        outline: none;
    }

.numeric-input {
    text-align: right;
    font-family: 'Consolas', 'Courier New', monospace;
}

/* Split form control (e.g. restrictions / wind speed) */
.form-control-split {
    display: flex;
    align-items: center;
    gap: 8px;
}

.split-input {
    flex: 1;
}

.split-separator {
    color: #7f8c8d;
    font-weight: 500;
}

/* ---------- Toggle filters button ---------- */
.toggle-filters {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background-color: transparent;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    cursor: pointer;
    color: #7f8c8d;
}

    .toggle-filters:hover {
        background-color: #f1ecec;
        color: #2c3e50;
    }

/* ---------- Advanced filters ---------- */
.advanced-filters {
    background-color: white;
    border-radius: 6px;
    padding: 1.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #e74c3c;
    margin: 1rem 0 1.5rem;
}

/* ---------- Corner forces tables ---------- */
.corner-forces-section {
    margin-top: 1.5rem;
}

.table-header-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 0.5rem;
}

.table-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem;
    background-color: #ede6e6;
    color: #34495e;
    border-radius: 4px 4px 0 0;
}

.forces-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.forces-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    border: 1px solid #dce4ec;
    background-color: white;
}

    .forces-table th,
    .forces-table td {
        padding: 0.6rem 0.5rem;
        text-align: center;
        border: 1px solid #dce4ec;
    }

    .forces-table th {
        background-color: #f5f0f0;
        font-weight: 600;
        color: #34495e;
    }

    .forces-table td:first-child {
        text-align: left;
        font-weight: 500;
        background-color: #faf8f8;
        width: 80px;
        color: #34495e;
    }

    .forces-table input {
        padding: 0.4rem 0.6rem;
        height: 28px;
        font-size: 0.9rem;
    }

/* Consolidated forces table */
.consolidated-forces-table {
    width: 100%;
    margin-bottom: 1.5rem;
}

    .consolidated-forces-table th:first-child {
        width: 220px;
    }

/* Anchor forces */
.anchor-forces-section {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #dce4ec;
    padding: 1.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.anchor-forces-table {
    width: 100%;
    max-width: 600px;
    margin: 1rem auto;
}

    .anchor-forces-table th:first-child {
        width: 180px;
    }

.restrictions-display {
    min-height: 38px;
    max-height: 80px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
}

/* ---------- Action buttons (general) ---------- */
.search-actions, .action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(90deg, #c0392b 0%, #e74c3c 100%);
    color: white;
    border: none;
}

    .btn-primary:hover:not(:disabled) {
        background: linear-gradient(90deg, #8e2c22 0%, #c0392b 100%);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .btn-primary:disabled {
        background: #95a5a6;
        cursor: not-allowed;
        opacity: 0.6;
    }

.btn-outline {
    background-color: transparent;
    color: #7f8c8d;
    border: 1px solid #bdc3c7;
}

    .btn-outline:hover {
        background-color: #f1ecec;
        color: #2c3e50;
    }

.btn-icon {
    padding: 0.4rem 0.7rem;
    font-size: 0.9rem;
}

/* Hide the legacy action-buttons block (replaced by fixed footer) */
.action-buttons {
    display: none;
}

/* ---------- Results section ---------- */
.results-section {
    max-width: 60%;
    min-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e1e5eb;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: #34495e;
}

.pagination-controls {
    display: flex;
    gap: 0.4rem;
}

/* ---------- Divided table cells ---------- */
.divided-cell {
    position: relative;
    padding: 0;
    height: 60px;
}

.cell-top, .cell-bottom {
    position: absolute;
    width: 100%;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
}

.cell-top {
    top: 0;
    border-bottom: 1px dashed #ccc;
    background-color: #fff5f4;
    font-size: 0.9em;
    color: #e74c3c;
}

.cell-bottom {
    bottom: 0;
}

.calculated-value {
    font-weight: 500;
}

/* ---------- Table legend ---------- */
.table-legend {
    display: flex;
    margin-top: 10px;
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    margin-right: 5px;
}

.table-legend .legend-item span {
    display: inline-block;
    vertical-align: middle;
}

/* ---------- Top climbing / reference sections ---------- */
.top-climbing-section, .reference-section {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #dce4ec;
    padding: 1.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

    .top-climbing-section .form-grid,
    .reference-section .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

/* ---------- Metadata section ---------- */
.metadata-section {
    background-color: #faf8f8;
    border-top: 1px solid #dce4ec;
    margin-bottom: 0;
    padding: 1rem 1.25rem;
}

    .metadata-section .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }

/* ---------- Units / cell labels ---------- */
.units-label {
    font-size: 0.75rem;
    font-weight: normal;
    color: #666;
    margin-top: 2px;
}

.cell-unit {
    font-size: 0.75rem;
    color: #666;
    margin-left: 3px;
}

/* ---------- No results / empty state ---------- */
.no-results {
    background-color: white;
    border-radius: 6px;
    border: 1px solid #dce4ec;
    padding: 3rem 1.5rem;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

    .no-results h3 {
        margin: 0 0 0.5rem 0;
        color: #2c3e50;
    }

    .no-results p {
        margin: 0;
        color: #7f8c8d;
    }

/* ---------- Section divider ---------- */
.section-divider {
    height: 2px;
    background-color: #f1ecec;
    margin: 2rem 0;
}

/* ---------- Loading spinner ---------- */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #e74c3c;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Fixed action footer ---------- */
.fixed-action-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #dce4ec;
    box-shadow: 0 -2px 10px rgba(231, 76, 60, 0.1);
    z-index: 1000;
    padding: 12px 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

    .footer-buttons .btn {
        min-height: 40px;
        padding: 8px 16px;
        font-weight: 500;
        border-radius: 6px;
        display: flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
        text-decoration: none;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
    }

        .footer-buttons .btn i {
            font-size: 14px;
        }

/* ---------- Confirmation dialog ---------- */
.confirmation-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-width: 90%;
    width: 450px;
}

    .confirmation-dialog.show {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
    }

.dialog-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    text-align: center;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

    .dialog-content h4 {
        margin: 0 0 16px 0;
        font-size: 24px;
        font-weight: 600;
        color: #1f2937;
        line-height: 1.3;
    }

    .dialog-content p {
        margin: 0 0 16px 0;
        font-size: 16px;
        color: #6b7280;
        line-height: 1.5;
    }

        .dialog-content p:last-of-type {
            margin-bottom: 24px;
        }

        /* Warning text in dialogs */
        .dialog-content p.warning {
            color: #f57c00;
            font-weight: 500;
            font-size: 14px;
            font-style: italic;
        }

        /* Error text in dialogs (Copy mode) */
        .dialog-content p.error {
            color: #d32f2f;
            font-weight: 600;
            font-size: 15px;
            background-color: #ffebee;
            padding: 8px 12px;
            border-radius: 4px;
            border-left: 3px solid #d32f2f;
        }

.dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

    .dialog-actions .btn {
        padding: 12px 24px;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        min-width: 120px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        outline: none;
    }

        .dialog-actions .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

    /* Cancel button (red) */
    .dialog-actions .btn-cancel {
        background-color: #dc2626;
        color: white;
        border: 2px solid #dc2626;
    }

        .dialog-actions .btn-cancel:hover:not(:disabled) {
            background-color: #b91c1c;
            border-color: #b91c1c;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
        }

    /* Confirm button (blue) */
    .dialog-actions .btn-confirm {
        background-color: #2563eb;
        color: white;
        border: 2px solid #2563eb;
    }

        .dialog-actions .btn-confirm:hover:not(:disabled) {
            background-color: #1d4ed8;
            border-color: #1d4ed8;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
        }

        .dialog-actions .btn-confirm:disabled {
            background-color: #94a3b8;
            border-color: #94a3b8;
        }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 992px) {
    .results-section {
        max-width: 100%;
        min-width: auto;
    }

    .top-climbing-section .form-grid,
    .reference-section .form-grid,
    .metadata-section .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .footer-buttons {
        flex-direction: column;
        gap: 8px;
    }

        .footer-buttons .btn {
            width: 100%;
            justify-content: center;
            max-width: 300px;
        }

    .page-container {
        margin-bottom: 240px; /* extra space for stacked buttons */
    }

    .confirmation-dialog {
        width: 95%;
        max-width: none;
    }

    .dialog-content {
        padding: 24px 20px;
    }

        .dialog-content h4 {
            font-size: 20px;
        }

    .dialog-actions {
        flex-direction: column;
        align-items: stretch;
    }

        .dialog-actions .btn {
            min-width: auto;
            width: 100%;
        }

    .form-control-split {
        flex-direction: column;
        align-items: stretch;
    }

    .split-separator {
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .forces-tables {
        grid-template-columns: 1fr;
    }

    .table-header-row {
        display: none;
    }

    .anchor-forces-table {
        max-width: 100%;
    }

    .top-climbing-section .form-grid,
    .reference-section .form-grid,
    .metadata-section .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}
