/**
 * Ticket Exchange Modal Styles
 * @package CT_Organizer_Dashboard
 * @version 2.1.0
 */

/* ============================================
   EXCHANGE BUTTON ON EVENT CARDS
   ============================================ */

.ctod-exchange-action {
    margin-top: 8px;
    text-align: right;
}

.ctod-btn-exchange {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff;
    color: #09888D;
    border: 2px solid #09888D;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ctod-btn-exchange:hover {
    background: #09888D;
    color: #fff;
}

.ctod-btn-exchange .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ============================================
   MODAL BASE
   ============================================ */

.ctod-exchange-modal-content {
    max-width: 640px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.ctod-exchange-modal-content .ctod-modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 0;
}

/* ============================================
   STEP INDICATOR
   ============================================ */

.ctod-exchange-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.ctod-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #999;
    font-size: 13px;
}

.ctod-step.active {
    color: #09888D;
    font-weight: 600;
}

.ctod-step.completed {
    color: #4CAF50;
}

.ctod-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ccc;
    font-size: 12px;
    font-weight: 700;
}

.ctod-step.active .ctod-step-num {
    background: #09888D;
    border-color: #09888D;
    color: #fff;
}

.ctod-step.completed .ctod-step-num {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

.ctod-step-divider {
    width: 40px;
    height: 2px;
    background: #ddd;
    margin: 0 12px;
}

.ctod-step-label {
    display: none;
}

@media (min-width: 520px) {
    .ctod-step-label {
        display: inline;
    }
}

/* ============================================
   PANELS
   ============================================ */

.ctod-exchange-panel {
    padding: 20px 24px;
}

.ctod-exchange-source-name {
    margin: 0 0 4px;
    font-size: 16px;
    color: #333;
}

.ctod-exchange-instructions {
    color: #666;
    font-size: 13px;
    margin: 0 0 16px;
}

/* ============================================
   STEP 1 - TICKET SELECTION
   ============================================ */

.ctod-exchange-filter {
    margin-bottom: 12px;
}

.ctod-exchange-search-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.15s;
}

.ctod-exchange-search-wrapper:focus-within {
    border-color: #09888D;
    box-shadow: 0 0 0 2px rgba(9, 136, 141, 0.15);
}

.ctod-exchange-search-wrapper .dashicons {
    color: #999;
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

#ctod-exchange-filter-input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 13px;
    background: transparent;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

#ctod-exchange-filter-input::placeholder {
    color: #aaa;
}

.ctod-exchange-select-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
}

.ctod-exchange-select-all label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
}

.ctod-exchange-selected-count {
    color: #09888D;
    font-weight: 600;
}

.ctod-exchange-tickets-list {
    max-height: 350px;
    overflow-y: auto;
}

.ctod-exchange-order-group {
    margin-bottom: 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
}

.ctod-exchange-order-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f0f7f7;
    border-bottom: 1px solid #e8e8e8;
    font-size: 12px;
}

.ctod-exchange-order-label {
    font-weight: 700;
    color: #09888D;
}

.ctod-exchange-purchaser {
    color: #666;
}

.ctod-exchange-ticket-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.ctod-exchange-ticket-row:last-child {
    border-bottom: none;
}

.ctod-exchange-ticket-row:hover {
    background: #fafafa;
}

.ctod-exchange-ticket-row.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ctod-ticket-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #09888D;
}

.ctod-ticket-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.ctod-ticket-number {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.ctod-ticket-attendee {
    font-size: 13px;
    color: #555;
}

.ctod-ticket-email {
    font-size: 11px;
    color: #999;
}

.ctod-ticket-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ctod-status-checked-in {
    background: #fff3e0;
    color: #e65100;
}

/* ============================================
   STEP 2 - TARGET EVENTS
   ============================================ */

.ctod-exchange-targets-list {
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ctod-target-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.ctod-target-card:hover:not(.disabled) {
    border-color: #09888D;
    background: #f0f7f7;
}

.ctod-target-card.selected {
    border-color: #09888D;
    background: #e8f5f5;
    box-shadow: 0 0 0 1px #09888D;
}

.ctod-target-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #fafafa;
}

.ctod-target-info {
    flex: 1;
    min-width: 0;
}

.ctod-target-name {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ctod-target-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #666;
}

.ctod-target-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ctod-target-meta .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #09888D;
}

.ctod-target-capacity {
    flex-shrink: 0;
    text-align: right;
    margin-left: 16px;
}

.ctod-target-remaining {
    font-size: 12px;
    color: #4CAF50;
    font-weight: 600;
}

.ctod-target-remaining.ctod-no-capacity {
    color: #f44336;
}

.ctod-target-full {
    display: block;
    font-size: 11px;
    color: #f44336;
    margin-top: 2px;
}

/* ============================================
   STEP 3 - CONFIRM SUMMARY
   ============================================ */

.ctod-exchange-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ctod-exchange-summary-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ctod-exchange-from,
.ctod-exchange-to {
    flex: 1;
    min-width: 0;
}

.ctod-exchange-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 4px;
}

.ctod-exchange-from strong,
.ctod-exchange-to strong {
    font-size: 14px;
    color: #333;
    word-break: break-word;
}

.ctod-exchange-arrow {
    flex-shrink: 0;
    color: #09888D;
}

.ctod-exchange-arrow .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.ctod-exchange-summary-details {
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.ctod-exchange-summary-details p {
    margin: 0 0 8px;
    font-size: 14px;
}

.ctod-exchange-attendee-list {
    margin: 0;
    padding: 0 0 0 20px;
    font-size: 13px;
    color: #555;
}

.ctod-exchange-attendee-list li {
    margin-bottom: 2px;
}

.ctod-exchange-notes label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.ctod-exchange-notes textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
}

.ctod-exchange-notes textarea:focus {
    border-color: #09888D;
    outline: none;
    box-shadow: 0 0 0 2px rgba(9, 136, 141, 0.15);
}

.ctod-exchange-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    font-size: 13px;
    color: #795548;
}

.ctod-exchange-warning .dashicons {
    color: #ffa000;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ============================================
   RESULT STEP
   ============================================ */

.ctod-exchange-result {
    text-align: center;
    padding: 30px 20px;
}

.ctod-exchange-result-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.ctod-result-success {
    color: #4CAF50;
}

.ctod-result-error {
    color: #f44336;
}

.ctod-exchange-result-message {
    margin-top: 16px;
    font-size: 15px;
    color: #333;
}

/* ============================================
   FOOTER
   ============================================ */

.ctod-exchange-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #eee;
}

.ctod-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.ctod-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ctod-btn-primary {
    background: #09888D;
    color: #fff;
}

.ctod-btn-primary:hover:not(:disabled) {
    background: #077a7e;
}

.ctod-btn-secondary {
    background: #f0f0f0;
    color: #555;
}

.ctod-btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.ctod-btn-confirm {
    background: #09888D;
    color: #fff;
}

.ctod-btn-confirm:hover:not(:disabled) {
    background: #077a7e;
}

.ctod-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.ctod-exchange-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.ctod-exchange-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

/* ============================================
   MOBILE
   ============================================ */

@media (max-width: 600px) {
    .ctod-exchange-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .ctod-exchange-panel {
        padding: 16px;
    }

    .ctod-exchange-summary-row {
        flex-direction: column;
        gap: 8px;
    }

    .ctod-exchange-arrow {
        transform: rotate(90deg);
    }

    .ctod-target-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .ctod-target-capacity {
        margin-left: 0;
        text-align: left;
    }

    .ctod-target-meta {
        flex-direction: column;
        gap: 4px;
    }

    .ctod-exchange-footer {
        flex-direction: column;
    }

    .ctod-exchange-footer .ctod-btn {
        width: 100%;
        justify-content: center;
    }
}
