﻿/* ============================================================================
   CornerForces shared form styles
   Used by: CornerForcesDBNew.razor, CornerForcesDBEdit.razor, CornerForcesDBCopy.razor
   Consolidated from per-component <style> blocks. Class names are global.
   ============================================================================ */

.home-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #2980b9;
    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: #3498db;
        color: white;
        text-decoration: none;
    }

.form-container {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.08);
    padding: 1.5rem;
    margin-bottom: 80px;
}

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

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

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

.form-content {
    background-color: #fff;
    padding: 1rem;
    border-radius: 6px;
}

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

.wide-config-group {
    grid-column: 1 / -1;
}

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

.ballast-dropdown {
    min-width: 300px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

    .form-group label {
        font-size: 13px;
        margin-bottom: 4px;
        font-weight: 500;
        color: #555;
    }

.form-control, .form-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

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

.corner-forces-section {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.table-header {
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    padding: 6px;
    background-color: #f9e6e4;
    border-radius: 4px 4px 0 0;
}

    .table-header.in-operation {
        background-color: #fde9e7;
        color: #c0392b;
    }

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

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

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

    .forces-table th,
    .forces-table td {
        padding: 6px 4px;
        text-align: center;
        border: 1px solid #f2d4d1;
    }

    .forces-table th {
        background-color: #fdf0ed;
        font-weight: 600;
    }

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

.ballast-table {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    border-collapse: collapse;
    border: 1px solid #f2d4d1;
    background-color: white;
}

    .ballast-table td {
        padding: 6px;
        border: 1px solid #f2d4d1;
    }

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

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

.btn-primary {
    background-color: #e74c3c;
    color: white;
    border: 1px solid #c0392b;
}

    .btn-primary:hover {
        background-color: #c0392b;
    }

.btn-outline {
    border-color: #f2d4d1;
    color: #c0392b;
    background-color: white;
}

    .btn-outline:hover {
        background-color: #fff5f4;
        border-color: #e74c3c;
    }

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

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

.section-header {
    background: linear-gradient(90deg, #fcf5f4 0%, #f9e6e4 100%);
    padding: 0.75rem 1rem;
    border-left: 4px solid #e74c3c;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

    .section-header h4, .section-header h5 {
        margin: 0;
        font-weight: 600;
        font-size: 1rem;
        color: #c0392b;
    }

    .section-header h5 {
        font-size: 0.9rem;
    }

.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

    .radio-button input[type="radio"] {
        display: none;
    }

.radio-circle {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #bdc3c7;
    position: relative;
    transition: all 0.2s ease;
}

    .radio-circle:after {
        content: '';
        width: 10px;
        height: 10px;
        background-color: #e74c3c;
        border-radius: 50%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0);
        transition: transform 0.2s ease;
    }

.radio-button input[type="radio"]:checked + .radio-circle {
    border-color: #e74c3c;
}

    .radio-button input[type="radio"]:checked + .radio-circle:after {
        transform: translate(-50%, -50%) scale(1);
    }

.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 #f2d4d1;
    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 {
    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;
        }

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

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

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

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

    .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-row {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .history-row {
        flex-direction: column;
        gap: 1rem;
    }
}

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

    .tower-config-box {
        flex: 0 0 100%;
    }
}

.tower-configs-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tower-configs-table-container {
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.tower-configs-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

    .tower-configs-table thead {
        background-color: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
    }

    .tower-configs-table th {
        padding: 12px;
        text-align: left;
        font-weight: 600;
        color: #495057;
    }

    .tower-configs-table tbody tr {
        border-bottom: 1px solid #dee2e6;
    }

        .tower-configs-table tbody tr:hover {
            background-color: #f8f9fa;
        }

    .tower-configs-table td {
        padding: 8px 12px;
        vertical-align: middle;
    }

.tower-config-row.middle-row {
    background-color: #fff;
}

.tower-config-row.bottom-row {
    background-color: #f0f8ff;
}

.row-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-middle {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-bottom {
    background-color: #fff3e0;
    color: #f57c00;
}

.subtotal-value {
    font-weight: 600;
    color: #28a745;
}

.actions-cell {
    text-align: center;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    min-height: auto;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

    .btn-danger:hover {
        background-color: #c82333;
        border-color: #bd2130;
    }

.add-tower-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 0.9rem;
    border: 2px solid #0d6efd;
    border-radius: 8px;
    background-color: #eef5ff;
    color: #0d6efd;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

    .add-tower-btn:hover:not(:disabled) {
        background-color: #dbeafe;
        border-color: #0b5ed7;
        color: #0b5ed7;
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
    }

    .add-tower-btn:active:not(:disabled) {
        background-color: #cfe2ff;
    }

    .add-tower-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        background-color: #f5f5f5;
        border-color: #bfc7d1;
        color: #7a8594;
    }

.modification-history-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #fcf5f4;
    border-radius: 6px;
    border: 1px solid #f2d4d1;
}

.history-row {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.history-field {
    flex: 1;
}

    .history-field label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: #666;
        margin-bottom: 4px;
    }

.history-value {
    padding: 6px 10px;
    background-color: white;
    border: 1px solid #e8c5c0;
    border-radius: 4px;
    font-size: 13px;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    min-width: 300px;
    max-width: 400px;
    z-index: 99999;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

    .toast.show {
        opacity: 1;
        transform: translateY(0);
    }

.toast-success {
    border-left: 4px solid #28a745;
    background: #d4edda;
    color: #155724;
}

.toast-error {
    border-left: 4px solid #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.toast-warning {
    border-left: 4px solid #ffc107;
    background: #fff3cd;
    color: #856404;
}

.toast-info {
    border-left: 4px solid #17a2b8;
    background: #d1ecf1;
    color: #0c5460;
}

.tower-configs-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

    .tower-configs-section .section-header h5 {
        margin: 0;
        color: #333;
        font-weight: 600;
    }

.tower-configs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.tower-config-box {
    flex: 0 0 calc(25% - 12px);
    min-width: 220px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

    .tower-config-box:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

.tower-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

    .tower-config-header .row-number {
        font-weight: 600;
        color: #495057;
        font-size: 14px;
    }

.tower-config-actions {
    display: flex;
    gap: 5px;
}

    .tower-config-actions .btn-icon {
        width: 28px;
        height: 28px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s;
        font-size: 12px;
    }

    .tower-config-actions .btn-add {
        background-color: #28a745;
        color: white;
    }

        .tower-config-actions .btn-add:hover:not(:disabled) {
            background-color: #218838;
            transform: scale(1.05);
        }

        .tower-config-actions .btn-add:disabled {
            background-color: #6c757d;
            cursor: not-allowed;
            opacity: 0.5;
        }

    .tower-config-actions .btn-remove {
        background-color: #dc3545;
        color: white;
    }

        .tower-config-actions .btn-remove:hover {
            background-color: #c82333;
            transform: scale(1.05);
        }

.tower-config-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

    .tower-config-content .form-group {
        margin: 0;
    }

        .tower-config-content .form-group label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            color: #495057;
            margin-bottom: 5px;
        }

    .tower-config-content .form-control,
    .tower-config-content .form-select {
        width: 100%;
        font-size: 14px;
        padding: 8px 10px;
        border: 1px solid #ced4da;
        border-radius: 4px;
        transition: border-color 0.2s;
    }

        .tower-config-content .form-control:focus,
        .tower-config-content .form-select:focus {
            border-color: #80bdff;
            outline: none;
            box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        }

    .tower-config-content input[type="number"] {
        -moz-appearance: textfield;
    }

        .tower-config-content input[type="number"]::-webkit-outer-spin-button,
        .tower-config-content input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

.max-rows-message {
    padding: 12px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

    .max-rows-message i {
        font-size: 16px;
    }

.calculated-field {
    background-color: #e9ecef !important;
    cursor: not-allowed;
    font-weight: 600;
    color: #495057;
}

.subtotal-display {
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    border: 1px solid #dee2e6;
}

.subtotal-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

@media (max-width: 1400px) {
    .tower-config-box {
        flex: 0 0 calc(33.333% - 10px);
    }
}

@media (max-width: 992px) {
    .tower-config-box {
        flex: 0 0 calc(50% - 8px);
    }
}

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

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

.status-badges {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.match-count.warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.match-count.original-match {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    color: #1565c0;
}

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

.status-error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
}

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

    .status-error .status-title {
        color: #721c24;
    }

    .status-error .status-message {
        color: #721c24;
    }

.page-container {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.08);
    padding: 1.5rem;
    margin-bottom: 80px;
}
