/* Change Billing Cycle - Modern Card-Style Selector Design */

/* ========================================
   SERVICE INFO CARD
   ======================================== */

.service-info-card__grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: start;
}

.service-info-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.service-info-card__icon {
    width: 48px;
    height: 48px;
    background: rgba(103, 165, 82, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    color: #67a552;
}

.service-info-card__title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.service-info-card__subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.service-info-card__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.service-info-card__stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.service-info-card__stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.service-info-card__stat-value--price {
    color: #67a552;
}

.service-info-card__status {
    text-align: center;
}

.service-info-card__status-badge {
    padding: 12px 20px;
    background: rgba(103, 165, 82, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(103, 165, 82, 0.2);
}

/* Active Status (Green) */
.service-info-card__status-badge--active {
    background: rgba(103, 165, 82, 0.1);
    border-color: rgba(103, 165, 82, 0.2);
}

.service-info-card__status-badge--active .service-info-card__status-label,
.service-info-card__status-badge--active .service-info-card__status-value {
    color: #67a552;
}

/* Suspended Status (Amber/Orange) */
.service-info-card__status-badge--suspended {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
}

.service-info-card__status-badge--suspended .service-info-card__status-label,
.service-info-card__status-badge--suspended .service-info-card__status-value {
    color: #f59e0b;
}

/* Pending Status (Blue) */
.service-info-card__status-badge--pending {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.service-info-card__status-badge--pending .service-info-card__status-label,
.service-info-card__status-badge--pending .service-info-card__status-value {
    color: #3b82f6;
}

/* Cancelled/Terminated Status (Red) */
.service-info-card__status-badge--cancelled,
.service-info-card__status-badge--terminated {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.service-info-card__status-badge--cancelled .service-info-card__status-label,
.service-info-card__status-badge--cancelled .service-info-card__status-value,
.service-info-card__status-badge--terminated .service-info-card__status-label,
.service-info-card__status-badge--terminated .service-info-card__status-value {
    color: #ef4444;
}

.service-info-card__status-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.service-info-card__status-value {
    font-size: 18px;
    font-weight: 700;
}

/* ========================================
   BILLING COMPARISON PREVIEW
   ======================================== */

.billing-change-preview {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.billing-comparison__grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.billing-comparison__item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 28px 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.billing-comparison__item--current {
    background: #ffffff;
    border-color: #d1d5db;
}

.billing-comparison__item--new {
    background: linear-gradient(135deg, rgba(103, 165, 82, 0.03) 0%, rgba(103, 165, 82, 0.08) 100%);
    border-color: #67a552;
    border-width: 2px;
    position: relative;
    box-shadow: 0 4px 16px rgba(103, 165, 82, 0.12);
}

.billing-comparison__item--new:before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #67a552, #5a8f47);
    border-radius: 12px;
    z-index: -1;
    opacity: 0.1;
}

.billing-comparison__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.billing-comparison__item--new .billing-comparison__label {
    color: #67a552;
}

.billing-comparison__cycle {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.billing-comparison__price {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
    margin-bottom: 8px;
}

.billing-comparison__item--new .billing-comparison__price {
    color: #67a552;
}

.billing-comparison__due-date {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.billing-comparison__item--new .billing-comparison__due-date {
    color: #5a8f47;
}

.billing-comparison__per {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.billing-comparison__arrow {
    font-size: 32px;
    color: #67a552;
    animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% {
        transform: translateX(0);
        opacity: 0.6;
    }
    50% {
        transform: translateX(8px);
        opacity: 1;
    }
}

@keyframes flashUpdate {
    0% {
        background-color: rgba(103, 165, 82, 0.3);
        transform: scale(1.05);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* ========================================
   BILLING CYCLE GRID
   ======================================== */

.billing-cycle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* ========================================
   BILLING CYCLE CARD
   ======================================== */

.billing-cycle-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.billing-cycle-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #67a552;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.billing-cycle-card:hover {
    border-color: #67a552;
    box-shadow: 0 8px 24px rgba(103, 165, 82, 0.15);
    transform: translateY(-2px);
}

.billing-cycle-card:hover:before {
    opacity: 1;
}

/* Icon */
.billing-cycle-card__icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(103, 165, 82, 0.1);
    border-radius: 8px;
    font-size: 24px;
    color: #67a552;
    transition: all 0.3s ease;
}

.billing-cycle-card:hover .billing-cycle-card__icon {
    background: #67a552;
    color: #ffffff;
    transform: scale(1.1);
}

/* Content */
.billing-cycle-card__content {
    flex: 1;
}

.billing-cycle-card__name {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.billing-cycle-card__description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.billing-cycle-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(103, 165, 82, 0.1);
    color: #67a552;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

/* Arrow Icon */
.billing-cycle-card__arrow {
    flex-shrink: 0;
    font-size: 20px;
    color: #d1d5db;
    transition: all 0.3s ease;
}

.billing-cycle-card:hover .billing-cycle-card__arrow {
    color: #67a552;
    transform: translateX(4px);
}

/* ========================================
   CARD STATES
   ======================================== */

/* Current Cycle (Disabled State) */
.billing-cycle-card--current {
    border-color: #d1d5db;
    cursor: not-allowed;
    opacity: 0.7;
    background: #f9fafb;
}

.billing-cycle-card--current:hover {
    border-color: #d1d5db;
    box-shadow: none;
    transform: none;
}

.billing-cycle-card--current:before {
    display: none;
}

.billing-cycle-card--current .billing-cycle-card__icon {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.billing-cycle-card--current:hover .billing-cycle-card__icon {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    transform: none;
}

/* Selected State */
.billing-cycle-card--selected {
    border-color: #67a552;
    background: rgba(103, 165, 82, 0.02);
    box-shadow: 0 8px 24px rgba(103, 165, 82, 0.2);
}

.billing-cycle-card--selected:before {
    opacity: 1;
    width: 6px;
}

.billing-cycle-card--selected .billing-cycle-card__icon {
    background: #67a552;
    color: #ffffff;
}

.billing-cycle-card--selected .billing-cycle-card__arrow {
    color: #67a552;
}

/* Add checkmark to selected card */
.billing-cycle-card--selected:after {
    content: '\f058'; /* fa-check-circle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 24px;
    color: #67a552;
    animation: checkmarkPop 0.3s ease;
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 991px) {
    .billing-cycle-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .billing-cycle-card {
        padding: 20px;
    }

    .billing-cycle-card__icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .billing-cycle-card__name {
        font-size: 16px;
    }

    .billing-cycle-card__description {
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    .billing-cycle-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .billing-cycle-card {
        padding: 16px;
    }

    /* Service Info Card - Mobile */
    .service-info-card__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-info-card__stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .service-info-card__status {
        text-align: left;
    }

    .service-info-card .card__body {
        padding: 20px !important;
    }

    /* Billing Comparison - Mobile */
    .billing-comparison__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .billing-comparison__arrow {
        transform: rotate(90deg);
        font-size: 20px;
        animation: none; /* Disable pulse animation on mobile */
        order: 2; /* Place arrow between the two cards */
        display: flex;
        justify-content: center;
        align-items: center;
        height: 40px;
    }

    .billing-comparison__item--current {
        order: 1;
    }

    .billing-comparison__item--new {
        order: 3;
    }

    .billing-comparison__item {
        padding: 20px 16px;
    }

    .billing-comparison__price {
        font-size: 28px;
    }

    .billing-comparison__label {
        font-size: 10px;
    }
}

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

.loading-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .billing-cycle-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        page-break-inside: avoid;
    }

    .billing-cycle-card:hover {
        transform: none;
    }

    .billing-cycle-card__arrow {
        display: none;
    }
}
