/**
 * Reconciliation Period Detail - Tabs & Options Styling
 * Added for tabbed interface and options section
 */

.period-detail-tabs {
    margin: 20px 0;
    border-bottom: none;
}

.period-detail-tabs .nav-tabs {
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    border-bottom: 2px solid #dee2e6;
    border-radius: 6px 6px 0 0;
    padding: 0 15px;
}

.period-detail-tabs .nav-link {
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.period-detail-tabs .nav-link:hover {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background: rgba(13, 110, 253, 0.05);
}

.period-detail-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background: rgba(13, 110, 253, 0.05);
}

.period-detail-tab-content {
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 20px;
}

/* Options Form Styling */
.period-options-form {
    max-width: 800px;
}

.options-section {
    margin-bottom: 20px;
}

.options-section h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.options-section > p.text-muted {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.option-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.option-item:hover {
    background: #f0f1f3;
    border-color: #adb5bd;
}

.option-item.notification-option {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.02) 0%, rgba(32, 117, 219, 0.02) 100%);
    border-color: rgba(13, 110, 253, 0.1);
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.option-header .form-check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}

.option-header .form-check-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
}

/* Disabled by license styling */
.option-header .form-check-input.disabled-by-license {
    opacity: 0.5;
    cursor: not-allowed;
}

.option-header .form-check-input.disabled-by-license:hover {
    opacity: 0.5;
}

.license-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff3cd;
    color: #856404;
    font-size: 0.9rem;
    cursor: help;
    transition: all 0.2s ease;
}

.license-badge:hover {
    background: #ffc107;
    color: white;
    transform: scale(1.1);
}

/* Reusable lock icon class for inline license indicators */
.license-lock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    color: #dc3545;
    font-size: 0.95rem;
    cursor: help;
    transition: all 0.3s ease;
    animation: licensePulse 2s ease-in-out infinite;
}

.license-lock-icon:hover {
    color: #fff;
    background: #dc3545;
    border-radius: 50%;
    padding: 4px;
    transform: scale(1.2);
    animation: none;
}

/* Keyframe animation for license lock icon - pulse and color shift */
@keyframes licensePulse {
    0%, 100% {
        transform: scale(1);
        color: #dc3545;
    }
    50% {
        transform: scale(1.15);
        color: #c82333;
    }
}

.badge {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge.bg-warning {
    background: #fff3cd !important;
    color: #856404;
}

.option-body {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.option-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}

.option-body .form-select {
    margin-bottom: 10px;
}

.option-body .form-select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.65;
}

.option-body .form-control {
    margin-bottom: 10px;
}

.option-body .form-control:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.65;
}

.reminder-channels {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    flex-wrap: wrap;
}

.reminder-channels .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
}

.reminder-channels .form-check-input {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.reminder-channels .form-check-label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
}

/* Status badges in table */
.status-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.5rem;
    border-radius: 0.4rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

#queueNotificationsBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Info & Status Messages */
.text-info.small {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(23, 162, 184, 0.1);
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
}

#autoCloseInfo {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1), rgba(32, 117, 219, 0.05));
    border-left: 3px solid #17a2b8;
}

/* Keep dynamic table/content overflow inside the component, not the page */
.mutabakat-container,
.period-detail-tab-content,
.reconciliation-list,
.table-view,
#periodEntriesTableView,
#periodEntriesTableView .table-responsive {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

#periodEntriesTableView .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#periodEntriesTableView table {
    min-width: 1200px;
}

#periodEntriesTableView th,
#periodEntriesTableView td,
#periodDates,
.info-item .value {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Responsive */
@media (max-width: 768px) {
    .period-detail-tabs .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .reminder-channels {
        flex-direction: column;
        gap: 12px;
    }

    .option-body {
        padding: 10px;
    }

    .options-section h5 {
        flex-direction: column;
        align-items: flex-start;
    }

    .badge {
        margin-top: 8px;
    }

    .table-view {
        padding: 1rem;
    }
}
