/*
 * offers.css
 * Retention offers and communication modal styles.
 * Contains: offers group layout, add-on modal multi-select, add-on modal
 * subscription info, SMS modal, template item list.
 */

/* ═══════════════════════════════════════════════════════════════════════════
   OFFERS STYLING
   ═══════════════════════════════════════════════════════════════════════════ */
.offers-group {
    margin-bottom: 20px;
}

.offers-group h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.offer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    gap: 16px;
}

.offer-item.offer-eligible {
    background: #d4f9df;
    border-color: #86efac;
}

.offer-item.offer-ineligible {
    background: #ffdfdf;
    border-color: #fecaca;
}

.offer-info {
    flex: 1;
}

.offer-name {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    margin-bottom: 2px;
}

.offer-price {
    font-size: 11px;
    color: #6b7280;
}

.offer-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.offer-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}

.offer-badge.eligible {
    background: #dcfce7;
    color: #166534;
}

.offer-badge.ineligible {
    background: #fee2e2;
    color: #991b1b;
}

.offer-badge.renewal {
    background: #dbeafe;
    color: #1e40af;
}

/* Renewal Offer Styling */
.offer-item.offer-renewal {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.offer-item.offer-renewal.offer-eligible {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border-color: #93c5fd;
}

.offer-item.offer-renewal .offer-info {
    flex: 1;
}

.offer-item.offer-renewal .offer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.offer-item.offer-renewal .offer-description-text {
    font-size: 11px;
    color: #4b5563;
    line-height: 1.4;
}

.offer-item.offer-renewal .offer-url-preview {
    font-size: 10px;
    color: #6b7280;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 6px;
    word-break: break-all;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .offer-item.offer-renewal .offer-url-preview {
    background: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
}

.offer-renewal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-around;
}

.offer-renewal-actions .btn-xs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: fit-content;
}

.send-renewal-sms-btn {
    background: #2563eb;
    color: white;
    border: none;
}

.send-renewal-sms-btn:hover {
    background: #1d4ed8;
    color: white;
}

.renewal-link-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.renewal-link-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.copy-renewal-link-btn {
    background: transparent;
    color: #6b7280;
    border: none;
    padding: 6px;
}

.copy-renewal-link-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
}

/* Dark mode renewal styling */
[data-theme="dark"] .offer-badge.renewal {
    background: #1e3a5f;
    color: #93c5fd;
}

[data-theme="dark"] .offer-item.offer-renewal.offer-eligible {
    background: linear-gradient(135deg, #1e3a5f 0%, #312e81 100%);
    border-color: #3b82f6;
}

[data-theme="dark"] .offer-item.offer-renewal .offer-description-text {
    color: #9ca3af;
}

[data-theme="dark"] .renewal-link-btn {
    background: #374151;
    color: #d1d5db;
    border-color: #4b5563;
}

[data-theme="dark"] .renewal-link-btn:hover {
    background: #4b5563;
    color: #e5e7eb;
}

[data-theme="dark"] .copy-renewal-link-btn {
    background: transparent;
    color: #9ca3af;
}

[data-theme="dark"] .copy-renewal-link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #d1d5db;
}

.offer-reason {
    font-size: 10px;
    color: #6b7280;
    font-style: italic;
}

.offer-sub-tag {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Ineligible Offers Collapsible Dropdown */
.ineligible-offers-dropdown {
    margin-top: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.ineligible-offers-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    transition: background-color 0.15s ease;
}

.ineligible-offers-toggle:hover {
    background: #e5e7eb;
}

.ineligible-offers-toggle .toggle-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.ineligible-offers-dropdown.expanded .toggle-chevron {
    transform: rotate(180deg);
}

.ineligible-offers-content {
    display: none;
    padding: 8px;
    background: #fafafa;
}

.ineligible-offers-dropdown.expanded .ineligible-offers-content {
    display: block;
}

.ineligible-offers-content .offer-item {
    margin-bottom: 6px;
}

.ineligible-offers-content .offer-item:last-child {
    margin-bottom: 0;
}

/* Dark mode support for ineligible dropdown */
[data-theme="dark"] .ineligible-offers-dropdown {
    border-color: #374151;
}

[data-theme="dark"] .ineligible-offers-toggle {
    background: #1f2937;
    color: #9ca3af;
}

[data-theme="dark"] .ineligible-offers-toggle:hover {
    background: #374151;
}

[data-theme="dark"] .ineligible-offers-content {
    background: #111827;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADD-ON MODAL MULTI-SELECT STYLING
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hint text for multi-select */
.addon-select-hint {
    font-weight: 400;
    font-size: 11px;
    color: #6b7280;
}

/* Checkbox styling for add-ons */
.addon-checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 4px;
}

.addon-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.addon-checkbox-custom {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    transition: all 0.15s ease;
    position: relative;
}

.addon-checkbox-custom::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.addon-checkbox:checked + .addon-checkbox-custom {
    background: #2563eb;
    border-color: #2563eb;
}

.addon-checkbox:checked + .addon-checkbox-custom::after {
    display: block;
}

.addon-checkbox-label:hover .addon-checkbox-custom {
    border-color: #9ca3af;
}

.addon-checkbox:checked + .addon-checkbox-custom:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* Add-on option item with checkbox layout */
#addon-modal .addon-option-item {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    gap: 12px;
}

#addon-modal .addon-option-item:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

#addon-modal .addon-option-item:hover .addon-checkbox-custom {
    border-color: #93c5fd;
}

#addon-modal .addon-option-item.selected {
    border-color: #2563eb;
    background: #eff6ff;
}

#addon-modal .addon-option-info {
    flex: 1;
    min-width: 0;
}

#addon-modal .addon-option-name {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

#addon-modal .addon-option-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

#addon-modal .addon-option-price {
    font-weight: 600;
    font-size: 14px;
    color: #059669;
    flex-shrink: 0;
}

/* Selected summary section */
.addon-selected-summary {
    margin-top: 16px;
    padding: 12px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
}

.addon-summary-title {
    font-weight: 600;
    font-size: 12px;
    color: #166534;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.addon-summary-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.addon-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.addon-summary-name {
    color: #1f2937;
}

.addon-summary-price {
    color: #059669;
    font-weight: 500;
}

.addon-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #86efac;
    font-weight: 600;
}

.addon-summary-total span:first-child {
    color: #166534;
}

.addon-total-price {
    font-size: 16px;
    color: #059669;
}

/* Dark mode styles for add-on multi-select */
[data-theme="dark"] .addon-select-hint {
    color: #9ca3af;
}

[data-theme="dark"] .addon-checkbox-custom {
    background: #374151;
    border-color: #4b5563;
}

[data-theme="dark"] .addon-checkbox-label:hover .addon-checkbox-custom {
    border-color: #6b7280;
}

[data-theme="dark"] .addon-checkbox:checked + .addon-checkbox-custom {
    background: #3b82f6;
    border-color: #3b82f6;
}

[data-theme="dark"] #addon-modal .addon-option-item {
    border-color: #374151;
    background: #1f2937;
}

[data-theme="dark"] #addon-modal .addon-option-item:hover {
    border-color: #3b82f6;
    background: #1e3a5f;
}

[data-theme="dark"] #addon-modal .addon-option-item.selected {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] #addon-modal .addon-option-name {
    color: #e5e7eb;
}

[data-theme="dark"] #addon-modal .addon-option-desc {
    color: #9ca3af;
}

[data-theme="dark"] #addon-modal .addon-option-price {
    color: #34d399;
}

[data-theme="dark"] .addon-selected-summary {
    background: rgba(16, 185, 129, 0.1);
    border-color: #059669;
}

[data-theme="dark"] .addon-summary-title {
    color: #34d399;
}

[data-theme="dark"] .addon-summary-name {
    color: #e5e7eb;
}

[data-theme="dark"] .addon-summary-price {
    color: #34d399;
}

[data-theme="dark"] .addon-summary-total {
    border-color: #059669;
}

[data-theme="dark"] .addon-summary-total span:first-child {
    color: #34d399;
}

[data-theme="dark"] .addon-total-price {
    color: #34d399;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADD-ON MODAL STYLING
   ═══════════════════════════════════════════════════════════════════════════ */
#addon-modal .addon-sub-info {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

#addon-modal .addon-sub-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

#addon-modal .addon-sub-info p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

#addon-modal .addon-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

#addon-modal .addon-option-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    justify-content: space-between;
}

#addon-modal .addon-option-item:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

#addon-modal .addon-option-item.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

#addon-modal .addon-option-item.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

#addon-modal .addon-option-item.unavailable:hover {
    border-color: #e5e7eb;
    background: #f9fafb;
}

#addon-modal .addon-option-item input[type="radio"] {
    margin-right: 12px;
    accent-color: #3b82f6;
}

#addon-modal .addon-option-info {
    flex: 1;
}

#addon-modal .addon-option-name {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
}

#addon-modal .addon-option-price {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

#addon-modal .addon-option-status {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

#addon-modal .addon-option-status.available {
    background: #dcfce7;
    color: #166534;
}

#addon-modal .addon-option-status.already-active {
    background: #fef3c7;
    color: #92400e;
}

#addon-modal .addon-selected-details {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 12px;
    margin-top: 16px;
}

#addon-modal .addon-selected-details h5 {
    font-size: 12px;
    font-weight: 600;
    color: #1e40af;
    margin: 0 0 8px 0;
}

#addon-modal .addon-selected-details p {
    font-size: 11px;
    color: #3b82f6;
    margin: 0;
    line-height: 1.5;
}

/* Add-on badge in subscription detail */
.addon-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 500;
}

.addon-tag.active {
    background: #dcfce7;
    color: #166534;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SMS MODAL STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
#sms-modal .modal-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 480px;
    width: 100%;
}

[data-theme="dark"] #sms-modal .modal-container {
    background: var(--modal-bg);
}

#sms-modal .modal-header {
    background: linear-gradient(135deg, #f0fdf4, #fff);
    border-bottom: 1px solid #dcfce7;
}

#sms-modal .modal-header h3 {
    color: #166534;
}

#sms-modal .form-group {
    margin-bottom: 16px;
}

#sms-modal .form-group label {
    font-size: 11px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

[data-theme="dark"] #sms-modal .form-group label {
    color: var(--text-muted);
}

#sms-modal input[type="tel"],
#sms-modal select,
#sms-modal textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

[data-theme="dark"] #sms-modal input[type="tel"],
[data-theme="dark"] #sms-modal select,
[data-theme="dark"] #sms-modal textarea {
    background: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

#sms-modal input[type="tel"]:focus,
#sms-modal select:focus,
#sms-modal textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] #sms-modal input[type="tel"]:focus,
[data-theme="dark"] #sms-modal select:focus,
[data-theme="dark"] #sms-modal textarea:focus {
    border-color: var(--hawx-teal);
    box-shadow: 0 0 0 3px rgba(99, 118, 117, 0.35);
}

#sms-modal textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.5;
}

#sms-modal .sms-char-count {
    font-size: 11px;
    color: #9ca3af;
    text-align: right;
    margin-top: 4px;
}

[data-theme="dark"] #sms-modal .sms-char-count {
    color: var(--text-muted);
}

#sms-modal .sms-char-count.warning {
    color: #f59e0b;
}

#sms-modal .sms-char-count.over {
    color: #ef4444;
    font-weight: 600;
}

/* Template Usage Hint */
#sms-modal .sms-template-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: #92400e;
}

[data-theme="dark"] #sms-modal .sms-template-hint {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fcd34d;
}

#sms-modal .sms-template-hint .hint-icon {
    flex-shrink: 0;
    font-size: 14px;
}

#sms-modal .sms-template-hint .hint-text {
    flex: 1;
}

#sms-modal .btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

#sms-modal .btn-primary {
    background: #10b981;
    color: #fff;
}

#sms-modal .btn-primary:hover {
    background: #059669;
}

#sms-modal .btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

#sms-modal .btn-ghost {
    background: #fff;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

#sms-modal .btn-ghost:hover {
    background: #f3f4f6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TEMPLATE ITEM STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
.template-item {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.template-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #10b981;
}

.template-item:active {
    transform: translateY(0);
}

