﻿/* ============================================================
   findforces-form.css
   Shared styles for FindForcesNew, FindForcesEdit, and
   FindForcesCopy components.
   ============================================================ */

/* ---------- Wide config / dropdown ---------- */
.wide-config-group {
    width: 100%;
}

.wide-dropdown {
    min-width: 500px;
    width: 100%;
}

    .wide-dropdown input {
        width: 100%;
    }

/* ---------- Filterable field indicators ---------- */
.ballast-table tr {
    position: relative;
}

    .ballast-table tr.has-filter-options::after {
        content: "•";
        display: inline-block;
        color: #28a745;
        font-size: 1.5rem;
        line-height: 0;
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
    }

.filterable-field {
    border-color: #28a745 !important;
    background-color: rgba(40, 167, 69, 0.05) !important;
    box-shadow: 0 0 0 1px rgba(40, 167, 69, 0.25) !important;
    transition: all 0.3s ease;
}

.form-group.has-filter-options::after {
    content: "•";
    display: inline-block;
    color: #28a745;
    font-size: 1.5rem;
    line-height: 0;
    position: absolute;
    right: 5px;
    top: 12px;
}

/* ---------- Field auto-fill highlight animation ---------- */
.field-autofilled {
    animation: highlight-autofill 2s ease;
}

@keyframes highlight-autofill {
    0%, 100% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(0, 119, 204, 0.2);
    }
}

/* ---------- Clear-all button ---------- */
.clear-all-button {
    margin-left: 10px;
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

    .clear-all-button:hover {
        background-color: #d32f2f;
    }

    .clear-all-button i {
        margin-right: 6px;
    }

/* ---------- Filter status notifications ---------- */
.filter-status-notification {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
}

    .filter-status-notification i {
        margin-right: 10px;
        font-size: 1.2rem;
    }

.notification-success {
    background-color: rgba(0, 128, 0, 0.15);
    border-left: 4px solid #008000;
    color: #006400;
}

.notification-warning {
    background-color: rgba(255, 165, 0, 0.15);
    border-left: 4px solid #FFA500;
    color: #805300;
}

.notification-unique {
    background-color: rgba(0, 119, 204, 0.15);
    border-left: 4px solid #0077CC;
    color: #004680;
}

/* ---------- Auto-fill button ---------- */
.auto-fill-button {
    margin-left: auto;
    padding: 5px 12px;
    background-color: #0077CC;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .auto-fill-button:hover {
        background-color: #005fa3;
    }

/* ---------- Fixed top header ---------- */
.fixed-header {
    position: fixed;
    top: 47px; /* Adjust to match main site header height */
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 4px 0;
}

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

.fixed-header .home-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-left: 1.75rem; /* Aligns with form content padding */
}

    .fixed-header .home-button:hover {
        background-color: #1d4ed8;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }

    .fixed-header .home-button i {
        font-size: 14px;
    }

/* ---------- Form container ---------- */
.form-container {
    max-width: 1200px;
    margin: 120px auto 80px; /* top: space for header, bottom: space for footer */
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    border: none;
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 32, 0.1);
    background-color: #f5f7fa;
    padding: 1.75rem;
    position: relative;
}

    .form-container:before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 4px;
        background: linear-gradient(90deg, #1e5799, #2989d8, #1e5799);
    }

/* ---------- 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;
    }

/* ---------- Form layout ---------- */
.form-content {
    background-color: white;
    border-radius: 6px;
    padding: 1.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
    position: relative; /* needed for has-filter-options indicator */
}

    .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: #f8fafc;
    color: #2c3e50;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

    .form-control:focus, .form-select:focus {
        border-color: #3498db;
        box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
        background-color: #fff;
        outline: none;
    }

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

/* Read-only numeric/text display (Copy mode) */
.numeric-display {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    color: #6c757d;
    cursor: not-allowed;
    font-family: inherit;
    min-height: 38px;
    display: flex;
    align-items: center;
}

.forces-table .numeric-display {
    text-align: right;
}

/* ---------- Job Information section ---------- */
.job-information-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* ---------- Corner forces section ---------- */
.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: #e6e9ed;
    color: #34495e;
    border-radius: 4px 4px 0 0;
}

    .table-header.in-operation {
        background-color: #d6e9f8; /* lighter blue */
    }

    .table-header.out-operation {
        background-color: #e8e8e8; /* light gray */
    }

.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: #f0f2f5;
        font-weight: 600;
        color: #34495e;
    }

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

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

        /* Read-only forces inputs (Edit mode) */
        .forces-table input[readonly] {
            background-color: #f5f5f5;
            cursor: not-allowed;
            opacity: 0.8;
        }

            .forces-table input[readonly]:focus {
                outline: none;
                box-shadow: none;
                border-color: #ced4da;
            }

/* ---------- Ballast table ---------- */
.ballast-table {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-collapse: collapse;
    border: 1px solid #dce4ec;
    background-color: white;
}

    .ballast-table td {
        padding: 0.6rem;
        border: 1px solid #dce4ec;
    }

.ballast-label {
    font-weight: 500;
    width: 150px;
    background-color: #f0f2f5;
    color: #34495e;
}

/* ---------- Form action buttons ---------- */
.form-actions {
    display: none; /* legacy block — replaced by fixed footer */
}

.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;
    text-decoration: none;
}

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

    .btn-primary:hover {
        background: linear-gradient(90deg, #1a4c85 0%, #2470a2 100%);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

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

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

/* Delete button (Edit mode) */
.btn-delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

    .btn-delete:hover {
        background: linear-gradient(135deg, #dc2626, #b91c1c);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    }

/* ---------- View unique config ---------- */
.view-unique-config-container {
    display: none; /* legacy block — replaced by fixed footer */
}

.view-config-circle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #8eda8e; /* light green */
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s, transform 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

    .view-config-circle-button:hover {
        background-color: #7bc97b;
        transform: scale(1.05);
    }

/* ---------- Custom dropdown ---------- */
.custom-dropdown {
    position: absolute;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ccc;
    z-index: 1000;
    width: 100%;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
}

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

    .dropdown-item.highlight {
        background-color: rgba(0, 123, 255, 0.1);
    }

/* ---------- 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 #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 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: 1000;
    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);
        animation: dialogSlideIn 0.3s ease;
    }

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Edit had a tighter dialog override — kept for parity */
.confirmation-dialog .dialog-content {
    pointer-events: auto;
}

.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;
        }

        .dialog-content p.warning {
            color: #dc2626;
            font-weight: 500;
            font-size: 14px;
        }

.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:focus {
            outline: none;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
        }

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

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

        .dialog-actions .btn-cancel:active {
            transform: translateY(0);
            box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
        }

        .dialog-actions .btn-cancel:focus {
            box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.5);
        }

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

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

        .dialog-actions .btn-confirm:active {
            transform: translateY(0);
            box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
        }

    /* Delete button inside dialog (Edit mode) */
    .dialog-actions .btn-delete {
        background-color: #dc2626;
        color: white;
        border: 2px solid #dc2626;
    }

        .dialog-actions .btn-delete:hover {
            background-color: #991b1b;
            border-color: #991b1b;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
        }

/* Prevent body scroll when dialog is open */
body.dialog-open {
    overflow: hidden;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
    .form-container {
        max-width: 95%;
    }
}

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

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

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

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

    .footer-buttons {
        flex-direction: column;
        gap: 8px;
    }

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

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

@media (max-width: 640px) {
    .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%;
        }
}

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