/* ============================================
   Readiness display in Status column
   ============================================ */

/* Readiness progress bar under status button */
.readiness-bar-wrapper {
    margin-top: 4px;
}

.readiness-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    line-height: 1;
    margin-bottom: 2px;
}

.readiness-percent {
    font-weight: 600;
}

.readiness-bar-track {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}

.readiness-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Color classes — used for both text and bar fill */
.readiness-low { color: #d9534f; }
.readiness-medium { color: #f0ad4e; }
.readiness-high { color: #5cb85c; }

.readiness-bar-fill.readiness-low { background: #d9534f; }
.readiness-bar-fill.readiness-medium { background: #f0ad4e; }
.readiness-bar-fill.readiness-high { background: #5cb85c; }

/* CanPublish icon */
.readiness-icon { font-weight: bold; }
.readiness-pass { color: #5cb85c; }
.readiness-fail { color: #d9534f; }

/* =============================================
   Readiness Wizard
   ============================================= */

.readiness-wizard-container .panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.readiness-wizard-container .panel-heading .close {
    float: none;
    opacity: 0.7;
    font-size: 24px;
    line-height: 1;
}

.readiness-wizard-container .panel-heading .close:hover {
    opacity: 1;
}

/* Validation options */
.validation-option {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.validation-option:hover {
    border-color: #428bca;
    background-color: #f5f9fc;
}

.validation-option.active {
    border-color: #5cb85c;
    background-color: #f0fff0;
}

.validation-option.active .validation-check .fa {
    color: #5cb85c;
}

.validation-option .validation-header {
    display: flex;
    align-items: center;
}

.validation-option .validation-header .validation-check {
    margin-right: 10px;
    font-size: 18px;
    color: #999;
}

.validation-option .validation-header .validation-name {
    font-weight: 500;
}

.validation-option .validation-value {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Action options */
.action-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-option:hover {
    border-color: #428bca;
    background-color: #f5f9fc;
}

.action-option.active {
    border-color: #428bca;
    background-color: #e8f4fc;
}

.action-option .action-icon {
    width: 60px;
    text-align: center;
    margin-right: 15px;
}

.action-option .action-info {
    flex: 1;
}

.action-option .action-info strong {
    font-size: 16px;
}

.action-option .action-info p {
    font-size: 13px;
}

/* Template buttons */
.readiness-wizard-container .btn-group-vertical .btn {
    text-align: left;
    white-space: normal;
    padding: 10px 15px;
    border-radius: 0;
}

.readiness-wizard-container .btn-group-vertical .btn:first-child {
    border-radius: 4px 4px 0 0;
}

.readiness-wizard-container .btn-group-vertical .btn:last-child {
    border-radius: 0 0 4px 4px;
}

.readiness-wizard-container .btn-group-vertical .btn:hover {
    background-color: #f5f5f5;
}

/* =============================================
   Weight Mode Bar
   ============================================= */

.weight-mode-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.weight-mode-bar .weight-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.weight-mode-bar .weight-mode-toggle .weight-mode-label {
    font-weight: 500;
    color: #555;
}

.weight-mode-bar .weight-mode-toggle .btn-group .btn {
    min-width: 80px;
}

.weight-mode-bar .weight-validation {
    font-size: 13px;
    font-weight: 500;
}

.weight-mode-bar .weight-validation .fa {
    margin-right: 5px;
}

/* Chart panel styling */
.readiness-rules-container + .col-md-4 .panel,
.col-md-4 > .panel {
    margin-bottom: 0;
}

.readiness-rules-container + .col-md-4 .panel .panel-heading,
.col-md-4 > .panel .panel-heading {
    background-color: #f5f5f5;
}

.readiness-rules-container + .col-md-4 .panel .panel-body,
.col-md-4 > .panel .panel-body {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Chart canvas */
#weightChart {
    max-width: 100%;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .weight-mode-bar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .readiness-rules-container {
        margin-bottom: 20px;
    }
}

/* Weight input styling in table */
.readiness-rules-table .editable-number input[type="number"] {
    width: 70px;
    text-align: center;
}

/* Warning state for invalid weights */
.weight-validation.text-danger {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Validation tiles for rule selection */
.validation-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.validation-tile {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    user-select: none;
}

.validation-tile:hover {
    border-color: #5d9cec;
    background-color: #f8fbff;
}

.validation-tile.active {
    border-color: #5cb85c;
    background-color: #dff0d8;
    color: #3c763d;
}

.validation-tile.active:hover {
    background-color: #d0e9c6;
}

.validation-tile .fa {
    font-size: 10px;
}

/* Selected validations configuration */
.selected-validations {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fafafa;
}

.selected-validation-item {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

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

.selected-validation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.selected-validation-header .validation-name {
    font-weight: 500;
    color: #333;
}

.selected-validation-input {
    max-width: 300px;
}

.selected-validation-input .form-control {
    margin-top: 5px;
}

/* =============================================
   Readiness Rules Table
   ============================================= */

.readiness-rules-container .panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
}

.readiness-rules-container .panel-heading .pull-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.readiness-rules-table {
    margin-bottom: 0;
}

.readiness-rules-table thead th {
    font-weight: 600;
    vertical-align: middle;
    white-space: nowrap;
}

.readiness-rules-table tbody tr:hover {
    background-color: #f9f9f9;
}

.readiness-rules-table tbody tr td {
    vertical-align: middle;
}

.readiness-rules-table .drag-handle {
    cursor: move;
    color: #999;
    text-align: center;
}

.readiness-rules-table .drag-handle:hover {
    color: #666;
}

.readiness-rules-table .sortable-table-item {
    background-color: transparent;
    border: none;
}

/* Editable field styling */
.readiness-rules-table .editable-click {
    border-bottom: 1px dashed #428bca;
    cursor: pointer;
}

.readiness-rules-table .editable-click:hover {
    color: #428bca;
}

/* Weight column */
.readiness-rules-table .weight-input {
    width: 70px;
    text-align: center;
}

/* Wizard container placeholder */
.readiness-wizard-container {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 20px;
    background-color: #fafafa;
}

/* Rule row drag placeholder */
.readiness-rule-row.ui-sortable-placeholder {
    visibility: visible !important;
    background-color: #e8f4fc !important;
    border: 2px dashed #428bca;
}

/* Empty state styling */
.readiness-rules-container .text-center.p-xl {
    padding: 40px;
}

.readiness-rules-container .text-center.p-xl .fa-3x {
    font-size: 3em;
    margin-bottom: 15px;
}

.readiness-rules-container .text-center.p-xl h4 {
    margin-bottom: 10px;
    color: #555;
}

.readiness-rules-container .text-center.p-xl p {
    margin-bottom: 20px;
}

/* Switch alignment in table */
.readiness-rules-table .switch {
    margin-bottom: 0;
}

/* =============================================
   Validation Editor Modal
   ============================================= */

#validationEditorModal .validation-options {
    max-height: 400px;
    overflow-y: auto;
}

#validationEditorModal .validation-option {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

#validationEditorModal .validation-option:hover {
    border-color: #428bca;
    background-color: #f5f9fc;
}

#validationEditorModal .validation-option.active {
    border-color: #5cb85c;
    background-color: #f0fff0;
}

#validationEditorModal .validation-option.active .validation-check .fa {
    color: #5cb85c;
}

#validationEditorModal .validation-option .validation-header {
    display: flex;
    align-items: center;
}

#validationEditorModal .validation-option .validation-header .validation-check {
    margin-right: 10px;
    font-size: 18px;
    color: #999;
}

#validationEditorModal .validation-option .validation-header .validation-name {
    font-weight: 500;
}

#validationEditorModal .validation-option .validation-value {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
