/**
 * Pricing Page Styles
 * 定价页面样式
 */

/* Plan Tab Styles */
.plan-tab {
    position: relative;
    transition: all 0.3s ease;
}

.plan-tab:hover {
    color: #3B82F6;
}

.plan-tab.active {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    color: white;
}

/* Plans Container */
#plans-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    min-height: 400px;
}

/* When there are 3 or more plans, use grid layout */
#plans-container.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    justify-content: center;
}

/* Plan Card Styles */
.plan-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 24px;
    position: relative;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 350px;
    min-width: 300px;
}

.plan-card:hover {
    border-color: #3B82F6;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.plan-card.popular {
    border-color: #3B82F6;
    border-width: 2px;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.15);
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
    .plan-card {
        background: #1F2937;
        border-color: #374151;
    }
    
    .plan-card:hover {
        border-color: #3B82F6;
        box-shadow: 0 10px 25px rgba(59, 130, 246, 0.2);
    }
    
    .plan-card.popular {
        border-color: #3B82F6;
        box-shadow: 0 10px 25px rgba(59, 130, 246, 0.25);
    }
}

/* Plan Badge */
.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.plan-badge.most-popular {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Discount Badge */
.discount-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Plan Header */
.plan-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #F3F4F6;
}

@media (prefers-color-scheme: dark) {
    .plan-header {
        border-bottom-color: #374151;
    }
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 8px;
}

@media (prefers-color-scheme: dark) {
    .plan-name {
        color: #F9FAFB;
    }
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 8px;
}

.plan-price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1F2937;
    line-height: 1;
}

@media (prefers-color-scheme: dark) {
    .plan-price-amount {
        color: #F9FAFB;
    }
}

.plan-price-period {
    font-size: 0.875rem;
    color: #6B7280;
    margin-left: 4px;
}

@media (prefers-color-scheme: dark) {
    .plan-price-period {
        color: #9CA3AF;
    }
}

.plan-billing-note {
    font-size: 0.75rem;
    color: #059669;
    font-weight: 500;
    margin: 4px 0 2px 0;
}

.plan-original-price {
    font-size: 0.75rem;
    color: #6B7280;
    margin: 2px 0 8px 0;
    font-weight: 500;
}

.plan-description {
    font-size: 0.875rem;
    color: #6B7280;
    margin-top: 8px;
}

@media (prefers-color-scheme: dark) {
    .plan-billing-note {
        color: #10B981;
    }
    
    .plan-original-price {
        color: #9CA3AF;
    }
    
    .plan-description {
        color: #9CA3AF;
    }
}

/* Plan Features */
.plan-features {
    flex-grow: 1;
    margin-bottom: 24px;
}

.plan-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    space-y: 12px;
}

.plan-feature {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}

.plan-feature-icon {
    color: #10B981;
    margin-right: 12px;
    margin-top: 2px;
    font-size: 14px;
    flex-shrink: 0;
}

.plan-feature-text {
    font-size: 0.875rem;
    color: #4B5563;
    line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
    .plan-feature-text {
        color: #D1D5DB;
    }
}

/* Plan Button */
.plan-button {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.plan-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.plan-button.primary {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.plan-button.primary:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.plan-button.secondary {
    background: white;
    color: #374151;
    border: 1px solid #D1D5DB;
}

.plan-button.secondary:hover:not(:disabled) {
    background: #F9FAFB;
    border-color: #9CA3AF;
}

@media (prefers-color-scheme: dark) {
    .plan-button.secondary {
        background: #374151;
        color: #D1D5DB;
        border-color: #4B5563;
    }
    
    .plan-button.secondary:hover:not(:disabled) {
        background: #4B5563;
        border-color: #6B7280;
    }
}

.plan-button.current {
    background: #F3F4F6;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

@media (prefers-color-scheme: dark) {
    .plan-button.current {
        background: #374151;
        color: #9CA3AF;
        border-color: #4B5563;
    }
}

/* Loading Animation */
.plans-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.plans-loading-dots {
    display: flex;
    space-x: 4px;
}

.plans-loading-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: loading-pulse 1.4s infinite ease-in-out;
}

.plans-loading-dot:nth-child(1) { animation-delay: -0.32s; }
.plans-loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-pulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    margin: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modal-enter 0.3s ease-out;
}

@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #1F2937;
    }
}

@keyframes modal-enter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #F3F4F6;
    margin-bottom: 24px;
}

@media (prefers-color-scheme: dark) {
    .modal-header {
        border-bottom-color: #374151;
    }
}

.modal-body {
    padding: 0 24px 24px 24px;
}

/* Payment Method Item */
.payment-method-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.payment-method-item:hover {
    border-color: #3B82F6;
    background: #F8FAFC;
}

@media (prefers-color-scheme: dark) {
    .payment-method-item {
        border-color: #374151;
        background: #374151;
    }
    
    .payment-method-item:hover {
        border-color: #3B82F6;
        background: #4B5563;
    }
}

.payment-method-info {
    display: flex;
    align-items: center;
}

.payment-method-icon {
    width: 40px;
    height: 40px;
    margin-right: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
}

@media (prefers-color-scheme: dark) {
    .payment-method-icon {
        background: #4B5563;
    }
}

.payment-method-details h4 {
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 4px 0;
}

@media (prefers-color-scheme: dark) {
    .payment-method-details h4 {
        color: #F9FAFB;
    }
}

.payment-method-details p {
    font-size: 0.875rem;
    color: #6B7280;
    margin: 0;
}

@media (prefers-color-scheme: dark) {
    .payment-method-details p {
        color: #9CA3AF;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .plan-card {
        margin-bottom: 24px;
    }
    
    .plan-price-amount {
        font-size: 2rem;
    }
    
    .modal-content {
        margin: 20px;
        max-width: calc(100vw - 40px);
    }
}

/* Error and Success States */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
}

.alert-error {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #B91C1C;
}

.alert-success {
    background: #F0FDF4;
    border: 1px solid #86EFAC;
    color: #166534;
}

.alert-warning {
    background: #FFFBEB;
    border: 1px solid #FCD34D;
    color: #D97706;
}

@media (prefers-color-scheme: dark) {
    .alert-error {
        background: rgba(185, 28, 28, 0.1);
        border-color: rgba(252, 165, 165, 0.3);
        color: #FCA5A5;
    }
    
    .alert-success {
        background: rgba(22, 101, 52, 0.1);
        border-color: rgba(134, 239, 172, 0.3);
        color: #86EFAC;
    }
    
    .alert-warning {
        background: rgba(217, 119, 6, 0.1);
        border-color: rgba(252, 211, 77, 0.3);
        color: #FCD34D;
    }
}

/* Animations */
.fade-in {
    animation: fade-in 0.5s ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}