/**
 * Get Payed Frontend Styles
 * 
 * @package GetPayed
 * @since 0.9.0
 */

/* Product Cards */
.gp-product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    max-width: 400px;
    margin: 20px auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.gp-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}

.gp-product-image {
    overflow: hidden;
    position: relative;
}

.gp-product-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gp-product-card:hover .gp-product-image img {
    transform: scale(1.05);
}

.gp-product-content {
    padding: 24px;
}

.gp-product-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #1a1a1a;
    line-height: 1.2;
}

.gp-product-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 14px;
}

/* Pricing Toggle */
.gp-pricing-toggle {
    display: flex;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
    position: relative;
}

.gp-billing-toggle {
    flex: 1;
    text-align: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.gp-billing-toggle input {
    display: none;
}

.gp-billing-toggle input:checked + span {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: #0073aa;
}

/* Pricing */
.gp-product-pricing {
    text-align: center;
    margin-bottom: 24px;
    min-height: 60px;
}

.gp-price {
    display: none;
    animation: fadeIn 0.3s ease;
}

.gp-price.active {
    display: block;
}

.gp-compare-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 8px;
    font-size: 18px;
}

.gp-current-price {
    font-size: 36px;
    font-weight: 700;
    color: #0073aa;
    line-height: 1;
}

.gp-price-period {
    color: #666;
    margin-left: 4px;
    font-size: 16px;
}

/* Features List */
.gp-product-features {
    margin-bottom: 24px;
}

.gp-product-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gp-product-features li {
    padding: 8px 0;
    position: relative;
    padding-left: 28px;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.gp-product-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 8px;
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
}

/* Subscribe Button */
.gp-subscribe-btn {
    width: 100%;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.gp-subscribe-btn:hover {
    background: linear-gradient(135deg, #005a87 0%, #004666 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,115,170,0.3);
}

.gp-subscribe-btn:active {
    transform: translateY(0);
}

.gp-subscribe-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Checkout Form */
.gp-checkout-form {
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.gp-checkout-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: #1a1a1a;
}

.gp-form-group {
    margin-bottom: 20px;
}

.gp-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.gp-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.gp-form-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.gp-form-input.error {
    border-color: #dc3545;
}

.gp-error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

.gp-success-message {
    color: #28a745;
    font-size: 14px;
    margin-top: 5px;
}

/* Coupon Field */
.gp-coupon-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.gp-coupon-input {
    flex: 1;
}

.gp-coupon-apply {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.gp-coupon-apply:hover {
    background: #218838;
}

.gp-coupon-success {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
}

/* Order Summary */
.gp-order-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.gp-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.gp-summary-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    font-weight: 700;
    font-size: 18px;
}

/* Account Dashboard */
.gp-account-dashboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.gp-account-header {
    text-align: center;
    margin-bottom: 40px;
}

.gp-subscription-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.gp-subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.gp-subscription-name {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.gp-subscription-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.gp-subscription-status.active {
    background: #d4edda;
    color: #155724;
}

.gp-subscription-status.canceled {
    background: #f8d7da;
    color: #721c24;
}

.gp-subscription-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.gp-detail-item {
    text-align: center;
}

.gp-detail-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.gp-detail-value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Loading States */
.gp-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.gp-loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .gp-product-card {
        margin: 10px;
        max-width: none;
    }
    
    .gp-checkout-form {
        margin: 10px;
        padding: 20px;
    }
    
    .gp-coupon-group {
        flex-direction: column;
    }
    
    .gp-subscription-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .gp-subscription-details {
        grid-template-columns: 1fr;
        text-align: left;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .gp-product-card,
    .gp-checkout-form,
    .gp-subscription-card {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .gp-product-title,
    .gp-checkout-title,
    .gp-subscription-name {
        color: #f7fafc;
    }
    
    .gp-form-input {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .gp-form-input:focus {
        border-color: #63b3ed;
    }
}