/**
 * Spirit Collective Affiliate Area Styles
 * File location: /wp-content/plugins/spirit-collective-custom-code/assets/css/affiliate-area.css
 * 
 * Only unique styles that can't be replaced with SC utility classes
 */

.bb-grid-cell:not(.no-gutter), .bb-grid>:not(.no-gutter) {
    padding-left: 0;
    padding-right: 0;
}
/* Content Width Fix */
#content .bb-grid {
	margin: 0;
    flex-direction: column;
}

/* #region Affiliate Area Base Styles     */
/* ======================================== */

/* Tab Navigation Override */
#affwp-affiliate-dashboard-tabs {
    background: var(--sc-color-bg-card);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-10);
    padding: 8px;
    margin-bottom: var(--sc-space-30);
    display: flex;
    gap: var(--sc-space-8);
    flex-wrap: wrap;
}

#affwp-affiliate-dashboard-tabs li {
    margin: 0;
}

#affwp-affiliate-dashboard-tabs a {
    display: block;
    padding: 12px 24px;
    background: var(--sc-color-bg-section);
    color: var(--sc-color-text);
    border-radius: var(--sc-radius-30);
    text-decoration: none;
    transition: all var(--sc-transition);
    font-weight: 500;
}

#affwp-affiliate-dashboard-tabs a:hover {
    background: var(--sc-color-btn-hover);
    color: var(--sc-color-primary);
}

#affwp-affiliate-dashboard-tabs .active a {
    background: var(--sc-color-primary);
    color: var(--sc-color-white);
}

/* Payment Method Cards */
.sc-payment-option:hover,
.sc-sharing-option:hover {
    border-color: var(--sc-color-primary);
    transform: translateY(-2px);
    box-shadow: var(--sc-shadow-hover);
}

.sc-payment-option.selected,
.sc-sharing-option.selected {
    border-color: var(--sc-color-primary);
}

.sc-payment-option .sc-option-badge {
    background: var(--sc-color-bg-accent);
    color: var(--sc-color-primary);
    padding: 15px;
    border-radius: var(--sc-radius-full);
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
    display: flex;
    align-content: center;
    align-items: center;
    height: fit-content;
    line-height: 1;
}

/* Status Icons */
.sc-status-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--sc-radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: var(--sc-space-10);
}

.sc-status-icon.complete {
    background: var(--sc-color-success);
    color: white;
}

.sc-status-icon.incomplete {
    background: var(--sc-color-warning);
    color: white;
}

/* Connection Status */
.sc-connection-status {
    background: var(--sc-color-bg-section);
    border-radius: var(--sc-radius-10);
    padding: var(--sc-space-20);
    display: flex;
    align-items: center;
    gap: var(--sc-space-15);
}

.sc-connection-status.success {
    border-left: 4px solid var(--sc-color-success);
}

.sc-connection-status i {
    color: var(--sc-color-success);
    font-size: 20px;
}

/* Form Overrides */
.sc-form-group label {
    display: block;
    margin-bottom: var(--sc-space-8);
    font-weight: 600;
    color: var(--sc-color-text);
}

.sc-form-group input[type="email"],
.sc-form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-10);
    font-size: 16px;
    transition: all var(--sc-transition);
}

.sc-form-group input:focus {
    outline: none;
    border-color: var(--sc-color-primary);
    box-shadow: var(--sc-shadow-input-focus);
}

.sc-field-description {
    margin-top: var(--sc-space-8);
    font-size: 14px;
    color: var(--sc-color-text-light);
}

.sc-field-description i {
    margin-right: var(--sc-space-5);
}

/* Tips Grid */
.sc-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--sc-space-30);
}

.sc-tip {
    text-align: center;
}

.sc-tip i {
    font-size: 32px;
    color: var(--sc-color-primary);
    display: block;
}

/* Sharing Tips */
.sc-sharing-tips {
    background: var(--sc-color-bg-section);
    border-radius: var(--sc-radius-10);
    padding: var(--sc-space-30);
    margin-top: var(--sc-space-30);
}

.sc-sharing-tips ul {
    margin: 0;
    padding-left: var(--sc-space-20);
}

.sc-sharing-tips li {
    margin-bottom: var(--sc-space-10);
}

/* Dark Mode Adjustments */
[data-theme="dark"] .sc-payment-option,
[data-theme="dark"] .sc-sharing-option {
    background: var(--sc-color-bg-section);
}

[data-theme="dark"] .sc-option-icon {
    background: var(--sc-color-bg-section-alt);
}

[data-theme="dark"] #affwp-affiliate-dashboard-tabs a {
    background: var(--sc-color-bg-section-alt);
}

/* #endregion Affiliate Area Base Styles */

/* #region AffiliateWP Content Overrides  */
/* ======================================== */

/* Hide duplicate titles/descriptions from AffiliateWP */
#affwp-affiliate-dashboard-campaign-stats, 
.affwp-generator-campaign-text-link-wrap,
#link-content .affwp-card__header p,
#coupon-content #affwp-affiliate-dashboard-coupons h4, 
#link-content .affwp-link-sharing__qrcode,
.affwp-affiliate-link__header {
    display: none !important;
}

#content .affwp-affiliate-link .affwp-card__content {
    padding-top: var(--affwp-card-padding);
}

/* Style the main affiliate link card */
#link-content .affwp-card {
    background: var(--sc-color-bg-section);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-10);
    padding: var(--sc-space-25);
    margin-bottom: var(--sc-space-30);
}

/* Affiliate link display */
#link-content .affwp-affiliate-link__display {
    display: flex;
    gap: var(--sc-space-15);
    margin-bottom: var(--sc-space-20);
}

#link-content .affwp-affiliate-link__input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-10);
    font-size: 16px;
    background: var(--sc-color-bg-section);
    color: var(--sc-color-text);
}

/* Copy Link Button */
#link-content .affwp-affiliate-link-copy-link {
    padding: 12px 24px;
    background: var(--sc-color-primary);
    color: var(--sc-color-white);
    border: none;
    border-radius: var(--sc-radius-30);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sc-transition);
}

#link-content .affwp-affiliate-link-copy-link:hover {
    background: var(--sc-color-primary-hover);
    transform: translateY(-2px);
}

/* Social sharing section */
#link-content .affwp-link-sharing {
    display: flex;
    align-items: center;
    gap: var(--sc-space-15);
    padding-top: var(--sc-space-20);
    border-top: 1px solid var(--sc-color-border);
}

#link-content .affwp-link-sharing__text {
    font-weight: 600;
    color: var(--sc-color-text);
}

#link-content .affwp-link-sharing__options {
    display: flex;
    gap: var(--sc-space-10);
}

#link-content .affwp-link-sharing__icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--sc-radius-full);
    transition: all var(--sc-transition);
    cursor: pointer;
}

#link-content .affwp-link-sharing__icon:hover {
    transform: scale(1.1);
}

#link-content .affwp-link-sharing__icon svg {
    width: 24px;
    height: 24px;
}

/* Custom Link Generator */
#affwp-custom-link-generator .affwp-card__header h3 {
    font-family: var(--sc-font-heading);
    font-size: 20px;
    color: var(--sc-color-text);
    margin-bottom: var(--sc-space-10);
}

#affwp-custom-link-generator input[type="url"],
#affwp-custom-link-generator input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-10);
    font-size: 16px;
    margin-top: var(--sc-space-8);
}

#affwp-custom-link-generator .button {
    padding: 12px 30px;
    background: var(--sc-color-btn-primary);
    color: var(--sc-color-text);
    border: 2px solid var(--sc-color-border);
    border-radius: var(--sc-radius-30);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sc-transition);
}

#affwp-custom-link-generator .button:hover {
    background: var(--sc-color-primary);
    color: var(--sc-color-white);
    border-color: var(--sc-color-primary);
}

/* Coupon Table */
#coupon-content .affwp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#coupon-content .affwp-table thead th {
    background: var(--sc-color-bg-section);
    padding: var(--sc-space-15) var(--sc-space-20);
    font-weight: 600;
    text-align: left;
    color: var(--sc-color-text);
    border-bottom: 2px solid var(--sc-color-border);
}

#coupon-content .affwp-table tbody td {
    padding: var(--sc-space-20);
    border-bottom: 1px solid var(--sc-color-border);
}

#coupon-content .affwp-table tbody tr:last-child td {
    border-bottom: none;
}

#coupon-content .affwp-table tbody td:first-child {
    font-family: monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--sc-color-primary);
}

/* Hide AffiliateWP tooltip - use our own if needed */
.affwp-card__tooltip {
    display: none;
}

/* Dark mode adjustments */
[data-theme="dark"] #coupon-content .affwp-table-wrap,
[data-theme="dark"] #affwp-custom-link-generator .affwp-card {
    background: var(--sc-color-bg-section);
}

[data-theme="dark"] #link-content .affwp-affiliate-link__input,
[data-theme="dark"] #affwp-custom-link-generator input {
    background: var(--sc-color-bg-section-alt);
    color: var(--sc-color-text);
}

/* #endregion AffiliateWP Content Overrides */


/* Tiered Rates Section */
.sc-tier-progress {
    position: relative;
}

.sc-tier-list {
    position: relative;
    padding-left: 30px;
}

.sc-tier-list::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: var(--sc-color-border);
}

.sc-tier-item {
    display: flex;
    align-items: center;
    gap: var(--sc-space-15);
    margin-bottom: var(--sc-space-20);
    position: relative;
}

.sc-tier-icon {
    position: absolute;
    left: -24px;
    width: 32px;
    height: 32px;
    background: var(--sc-color-bg-card);
    border-radius: var(--sc-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.sc-tier-icon i {
    font-size: 20px;
    color: var(--sc-color-border);
}

.sc-tier-item.completed .sc-tier-icon i {
    color: var(--sc-color-success);
}

.sc-tier-item.current .sc-tier-icon {
    background: var(--sc-color-primary);
}

.sc-tier-item.current .sc-tier-icon i {
    color: var(--sc-color-white);
}

.sc-tier-details {
    flex: 1;
    background: var(--sc-color-bg-section);
    padding: var(--sc-space-15) var(--sc-space-20);
    border-radius: var(--sc-radius-10);
}

.sc-tier-item.current .sc-tier-details {
    background: var(--sc-color-bg-accent);
    border: 2px solid var(--sc-color-primary);
}

.sc-tier-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--sc-space-5);
}

.sc-tier-label {
    font-weight: 600;
}

.sc-tier-rate {
    color: var(--sc-color-primary);
    font-weight: 700;
}

.sc-tier-requirement {
    font-size: 14px;
    color: var(--sc-color-text-light);
}

.sc-progress-bar {
    height: 8px;
    background: var(--sc-color-bg-section);
    border-radius: var(--sc-radius-full);
    overflow: hidden;
}

.sc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sc-color-primary) 0%, var(--sc-color-primary-hover) 100%);
    border-radius: var(--sc-radius-full);
    transition: width 0.3s ease;
}

/* Tier Summary in Accordion Header */
.sc-tier-summary {
    display: flex;
    align-items: center;
    gap: var(--sc-space-10);
    margin-left: auto;
    padding-left: 20px;
}

.sc-tier-summary-rate {
    font-weight: 700;
}

.sc-tier-summary-label {
    font-weight: 500;
}

/* Hide summary when accordion is expanded */
.sc-accordion-item.expanded .sc-tier-summary {
    opacity: 0.6;
}

/* Responsive - stack on small screens */
@media (max-width: 600px) {
    .sc-tiered-rates-section .sc-accordion-title {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sc-space-10);
    }
    
    .sc-tier-summary {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Fix canvas.overlay being hijacked by BuddyBoss .overlay class */
.affwp-graph canvas.overlay {
    position: absolute;
    z-index: auto;
    right: inherit;
    background-color: transparent;
    inset: auto;
}

/* Fix BuddyBoss table styles in legend */
.affwp-graph .legend table {
    border-spacing: 0 !important;
    max-width: none !important;
    width: auto !important;
    font-size: smaller !important;
    line-height: normal !important;
    margin-bottom: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}

/* Fix canvas display */
.affwp-graph canvas {
    display: block !important;
}

/* Fix td in legend */
.affwp-graph .legend td {
    vertical-align: middle !important;
    padding: 2px 5px !important;
    border: none !important;
    color: var(--sc-color-text) !important;
}

/* Legend background with theme-aware colors */
.affwp-graph .legend > div {
    background-color: var(--sc-color-bg-card) !important;
    border: 1px solid var(--sc-color-border) !important;
    opacity: 0.95 !important;
}

/* Legend text colors */
.affwp-graph .legend .legendLabel {
    color: var(--sc-color-text) !important;
}

/* Tick labels (dates and numbers on axes) */
.affwp-graph .tickLabels .tickLabel {
    color: var(--sc-color-text-light) !important;
}

/* Tooltip styling */
#affwp-flot-tooltip {
    color: var(--sc-color-white) !important;
    background: var(--sc-color-primary) !important;
    border: 1px solid var(--sc-color-primary) !important;
    padding: 5px 10px !important;
    border-radius: var(--sc-radius-5) !important;
}

/* Legend color box borders */
.affwp-graph .legend .legendColorBox > div {
    border-color: var(--sc-color-border) !important;
}


/* #region Stripe Connection Styles       */
/* ======================================== */

.sc-stripe-connection {
    margin-top: var(--sc-space-20);
}

.sc-stripe-options .sc-card {
    transition: all var(--sc-transition);
    cursor: default;
    border: 2px solid var(--sc-color-border);
}

.sc-stripe-options .sc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sc-shadow-hover);
    border-color: var(--sc-color-primary);
}

.sc-bg-warning {
    background-color: rgba(212, 165, 116, 0.1);
    border: 1px solid var(--sc-color-warning);
}

.sc-bg-warning p {
    color: var(--sc-color-text);
}

/* Connected status styling */
.sc-stripe-connected .sc-connection-status {
    display: flex;
    gap: var(--sc-space-15);
    align-items: flex-start;
    background: var(--sc-color-bg-section);
    padding: var(--sc-space-20);
    border-radius: var(--sc-radius-10);
    border-left: 4px solid var(--sc-color-success);
}

.sc-stripe-connected .sc-connection-status i {
    font-size: 24px;
    flex-shrink: 0;
    color: var(--sc-color-success);
}

/* Ensure our custom buttons look consistent */
#sc-stripe-connect-new,
#sc-stripe-connect-existing {
    min-height: 44px;
}

/* Dark mode adjustments */
[data-theme="dark"] .sc-bg-warning {
    background-color: rgba(217, 169, 126, 0.15);
    border-color: var(--sc-color-warning);
}

[data-theme="dark"] .sc-stripe-options .sc-card {
    background: var(--sc-color-bg-section);
    border-color: var(--sc-color-border);
}

[data-theme="dark"] .sc-stripe-connected .sc-connection-status {
    background: var(--sc-color-bg-section-alt);
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bb-icon-spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* Loading button states */
.sc-btn-loading {
    position: relative;
    cursor: wait !important;
    opacity: 0.8;
}

.sc-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

.sc-btn-loading i {
    margin-right: 8px;
}

/* Prevent layout shift when spinner appears */
.sc-stripe-options .sc-btn {
    min-width: 160px;
}

/* #endregion Stripe Connection Styles */

/* #region Step Cards                     */
/* ======================================== */

/* Navigation Buttons styled like accordions */
.sc-nav-button {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.sc-nav-button:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.sc-nav-button .sc-accordion-header {
    cursor: pointer;
}

.sc-nav-button:hover .sc-accordion-title {
    color: var(--sc-color-primary);
}

.sc-nav-button:hover .sc-accordion-icon {
    color: var(--sc-color-primary);
    transform: translateX(5px);
}

/* #region Step Cards                     */
/* ======================================== */

.sc-step-card {
    cursor: pointer;
    transition: all var(--sc-transition);
}

.sc-step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sc-shadow-hover);
    border-color: var(--sc-color-primary);
}

.sc-step-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: var(--sc-color-primary);
    flex-shrink: 0;
}

/* Copy button success state */
.button.success {
    background-color: var(--sc-color-success);
    color: white;
    border-color: var(--sc-color-success);
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .sc-steps-grid {
        gap: var(--sc-space-15) !important;
    }
    
    .sc-step-card {
        padding: var(--sc-space-15) !important;
    }
    
    .sc-step-number {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}

/* #endregion Step Cards */

/* #region Affiliate Stats Bar            */
/* ======================================== */

/* Stat item styling */
.sc-stat-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 6px;
    padding: 10px;
    background-color: var(--sc-color-bg-card);
    border: 1px solid var(--sc-color-border);
    text-align: center;
}

/* Font weight utility if not already in sc-styles */
.sc-font-weight-600 {
    font-weight: 600;
}

/* Mobile responsive for buttons */
@media (max-width: 480px) {
    .sc-stats-buttons {
        flex-direction: column;
    }
    
    .sc-stats-buttons .sc-btn {
        width: 100%;
    }
}

/* Success state for stats bar buttons */
.sc-affiliate-stats-bar .sc-btn.success {
    background-color: var(--sc-color-success);
    color: white;
    border-color: var(--sc-color-success);
}

/* #endregion Affiliate Stats Bar */