﻿/* =============================================================================
   Corner Forces — shared styles
   Used by CornerForcesNew, CornerForcesEdit, CornerForcesCopy.
   Per-parent <style> blocks should only hold rules unique to that parent.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Layout: container, header, footer
   ----------------------------------------------------------------------------- */

.fixed-header {
    position: fixed;
    top: 47px;
    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;
}

    .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 {
    max-width: 1200px;
    margin: 120px auto 80px;
    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);
    }

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

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

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

.wide-config-group {
    width: 100%;
}

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

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

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

/* -----------------------------------------------------------------------------
   Filterable field indicator (green dot for fields with options to narrow)
   ----------------------------------------------------------------------------- */

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

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

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

/* -----------------------------------------------------------------------------
   Filter status notification (the colored banner above the form)
   ----------------------------------------------------------------------------- */

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

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

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

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

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

/* -----------------------------------------------------------------------------
   Forces tables (In Operation / Out of Operation)
   ----------------------------------------------------------------------------- */

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

    .table-header.out-operation {
        background-color: #e8e8e8;
    }

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

        .forces-table input[readonly] {
            background-color: #f8f9fa;
            cursor: not-allowed;
        }

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

/* -----------------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------------- */

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

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

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

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

    .btn-secondary:hover {
        background-color: #545b62;
    }

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

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

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

.btn-config {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

    .btn-config:hover {
        background: linear-gradient(135deg, #7c3aed, #6d28d9);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
    }

/* The footer's "Save Changes" / "Create Copy" override */
.footer-buttons .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

    .footer-buttons .btn-primary:hover {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
    }

/* -----------------------------------------------------------------------------
   View configuration (green circle) button
   ----------------------------------------------------------------------------- */

.config-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-label {
    font-size: 0.9rem;
    color: #34495e;
    font-weight: 500;
}

.view-config-circle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #8eda8e;
    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);
    }

/* -----------------------------------------------------------------------------
   Verified status badge
   ----------------------------------------------------------------------------- */

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid transparent;
}

    .verified-badge i {
        font-size: 0.95rem;
    }

.verified-label {
    font-weight: 400;
    opacity: 0.8;
}

.verified-value {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.verified-badge.verified {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.verified-badge.unverified {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.verified-badge.incomplete {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* -----------------------------------------------------------------------------
   Confirmation dialogs
   ----------------------------------------------------------------------------- */

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

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

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

    .dialog-actions .btn-primary {
        background-color: #2563eb;
        color: white;
        border: 2px solid #2563eb;
    }

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

    .dialog-actions .btn:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    }

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

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    cursor: pointer;
}

/* -----------------------------------------------------------------------------
   Legacy form-actions hidden — superseded by .fixed-action-footer
   ----------------------------------------------------------------------------- */

.form-actions {
    display: none;
}

.config-actions {
    display: none;
}

/* -----------------------------------------------------------------------------
   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,
        .footer-buttons > div {
            width: 100%;
            justify-content: center;
            max-width: 300px;
        }

    .form-container {
        margin-top: 120px;
        margin-bottom: 240px;
    }
}

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