/**
 * My Subscription Plugin Frontend Styles
 * Enhances checkout fields, subscription pages, and bulk domain check UI.
 * Version: 1.4.2
 */

/* Reset and Base Styles */
.msp-cruip-page, .msp-subscription-page {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f7f9fc;
}

.msp-cruip-page *, .msp-subscription-page * {
    box-sizing: border-box;
}

/* Checkout Fields */
.woocommerce-checkout .form-row-wide {
    position: relative;
    margin-bottom: 20px;
}

.woocommerce-checkout .form-row-wide label {
    font-weight: 600;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.woocommerce-checkout .form-row-wide label::before {
    content: '\f111';
    font-family: 'Dashicons';
    margin-right: 6px;
    color: #787c82;
    font-size: 16px;
}

.woocommerce-checkout .form-row-wide input,
.woocommerce-checkout .form-row-wide textarea,
.woocommerce-checkout .form-row-wide input[type="file"] {
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 8px 12px;
    width: 100%;
    font-size: 16px;
}

.woocommerce-checkout .form-row-wide textarea {
    min-height: 100px;
}

.woocommerce-checkout .form-row-wide input[type="file"] {
    padding: 4px;
}

.woocommerce-checkout .description {
    font-style: italic;
    color: #646970;
    font-size: 14px;
    margin-top: 4px;
}

/* Domain Feedback */
.msp-domain-available {
    color: #2e7d32;
    font-weight: 600;
    margin-top: 8px;
    display: flex;
    align-items: center;
}

.msp-domain-error,
.msp-file-error {
    color: #d32f2f;
    font-weight: 600;
    margin-top: 8px;
    display: flex;
    align-items: center;
}

.msp-domain-available .dashicons,
.msp-domain-error .dashicons,
.msp-file-error .dashicons {
    margin-right: 6px;
    font-size: 18px;
}

/* Bulk Domain Check */
.msp-bulk-check {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px;
    margin: 20px 0;
}

#msp-bulk-domains {
    width: 100%;
    min-height: 120px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px;
    font-size: 16px;
}

#msp-bulk-check-button {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 8px;
}

#msp-bulk-check-button:hover {
    background: #1e40af;
}

.msp-bulk-results {
    margin-top: 12px;
}

.msp-bulk-results p {
    margin: 6px 0;
    display: flex;
    align-items: center;
}

.msp-bulk-results .dashicons {
    margin-right: 6px;
    font-size: 18px;
}

/* Original Subscription Page (Fallback) */
.msp-subscription-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.msp-subscription-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.msp-plan-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s;
}

.msp-plan-card:hover {
    transform: translateY(-5px);
}

.msp-plan-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msp-plan-card h3 .fas {
    margin-right: 10px;
    color: #2563eb;
}

.msp-plan-card .msp-plan-price {
    font-size: 20px;
    color: #16a34a;
    margin-bottom: 15px;
}

.msp-plan-card .msp-plan-details {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
    min-height: 60px;
}

.msp-plan-card .msp-plan-button {
    display: inline-flex;
    align-items: center;
    background: #2563eb;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 16px;
}

.msp-plan-card .msp-plan-button:hover {
    background: #1e40af;
}

.msp-plan-card .msp-plan-button .fas {
    margin-right: 8px;
}

.msp-subscription-status {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.msp-subscription-status h3 {
    font-size: 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.msp-subscription-status h3 .fas {
    margin-right: 10px;
}

.msp-subscription-status p {
    font-size: 14px;
    color: #6b7280;
}

.msp-subscription-status .msp-status-active {
    color: #16a34a;
    font-weight: 600;
}

.msp-subscription-status .msp-status-inactive {
    color: #dc2626;
    font-weight: 600;
}

/* Cruip-Inspired Subscription Page */
.msp-cruip-page {
    min-height: 100vh;
}

.msp-cruip-hero {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #fff;
    text-align: center;
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
}

.msp-cruip-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('<?php echo esc_url(MSP_PLUGIN_URL . 'assets/images/hero-image.jpg'); ?>') no-repeat center center/cover;
    opacity: 0.2;
    z-index: 0;
}

.msp-cruip-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.msp-cruip-hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
}

.msp-cruip-hero p {
    font-size: 20px;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

.msp-cruip-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.msp-cruip-content h2 {
    font-size: 36px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 40px;
}

.msp-cruip-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.msp-cruip-product {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.msp-cruip-product:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.msp-cruip-product-image {
    position: 100%;
    width: auto;
    padding-top: 80px; /* 1:1 aspect ratio */
}

.msp-cruip-subscription .msp-subscription-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msp-cruip-product-content {
    padding: 20px;
}

.msp-cruip-product h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.msp-cruip-product .msp-cruip-price {
    font-size: 20px;
    color: #16a34a;
    font-weight: 500;
    margin-bottom: 12px;
}

.msp-cruip-product .msp-cruip-details {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
    min-height: 48px;
}

.msp-cruip-product .msp-cruip-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold 500;
    transition: background-color 0.3s;
}

.msp-cruip-product .msp-cruip-button:hover {
    background: #1e40af;
}

.msp-cruip-product .msp-cruip-button .fas {
    margin-right: 10px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .msp-cruip-hero {
        padding: 60px 20px;
    }

    .msp-cruip-hero h1 {
        font-size: 36px;
    }

    .msp-cruip-hero p {
        font-size: 18px;
    }

    .msp-cruip-content h2 {
        font-size: 28px;
    }

    .msp-cruip-products {
        grid-template-columns: 1fr;
    }

    .msp-subscription-page .msp-plan-card .msp-plan-button {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .msp-cruip-hero h1 {
        font-size: 28px;
    }

    .msp-cruip-hero p {
        font-size: 16px;
    }

    .msp-cruip-content {
        padding: 20px;
    }

    .woocommerce-checkout .form-row-wide {
        margin-bottom: 15px;
    }

    .msp-bulk-check {
        padding: 10px;
    }

    #msp-bulk-domains {
        min-height: 80px;
    }
}