/* Clever Key Manager – Frontend Styles */

.ckm-packages-wrap {
    max-width: 1100px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ========================================= */
/* PACKAGE GRID                              */
/* ========================================= */

.ckm-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.ckm-package-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: box-shadow .2s ease, transform .2s ease;
    display: flex;
    flex-direction: column;
}

.ckm-package-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

.ckm-package-image {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f5f5f5;
}

.ckm-package-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ckm-package-body {
    padding: 20px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ckm-package-name {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.ckm-package-credits {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
    font-weight: 600;
}

.ckm-package-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.ckm-package-description p {
    margin: 0 0 8px;
}

.ckm-package-price {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.ckm-package-price span {
    font-size: 14px;
    font-weight: 400;
    color: #888;
}

/* Price Breakdown */
.ckm-price-breakdown {
    background: #f7f8fa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 13px;
}

.ckm-price-line {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    color: #555;
}

.ckm-price-line.ckm-price-total {
    border-top: 1px solid #ddd;
    margin-top: 6px;
    padding-top: 8px;
    font-weight: 700;
    color: #1a1a1a;
    font-size: 14px;
}

.ckm-subscribe-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease;
}

.ckm-subscribe-btn:hover {
    background: #005a87;
}

/* Buy Now (Booster) Button */
.ckm-buy-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: #e8a317;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease;
}

.ckm-buy-btn:hover {
    background: #c68c12;
}

/* Booster Badge */
.ckm-package-badge {
    background: #e8a317;
    color: #fff;
    text-align: center;
    padding: 6px 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ckm-package-onetime {
    border-color: #e8a317;
}

/* ========================================= */
/* MANAGE SUBSCRIPTION SECTION               */
/* ========================================= */

.ckm-manage-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-top: 20px;
}

.ckm-manage-section h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.ckm-manage-section > p {
    color: #666;
    margin: 0 0 16px;
}

#ckm-manage-step-code p {
    margin: 0 0 12px;
}

#ckm-manage-step-code a {
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
}

#ckm-manage-step-code a:hover {
    text-decoration: underline;
}

#ckm-manage-step-result a {
    color: #0073aa;
    text-decoration: none;
}

#ckm-manage-step-result a:hover {
    text-decoration: underline;
}

.ckm-manage-domain-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.ckm-manage-info {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px 20px;
}

.ckm-manage-info p {
    margin: 0 0 8px;
}

.ckm-manage-info p:last-child {
    margin-bottom: 0;
}

/* ========================================= */
/* INPUTS & BUTTONS                          */
/* ========================================= */

.ckm-input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    min-width: 240px;
}

.ckm-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.ckm-btn {
    padding: 8px 18px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease;
}

.ckm-btn:hover {
    background: #005a87;
}

.ckm-btn-danger {
    background: #dc3232;
    margin-top: 8px;
}

.ckm-btn-danger:hover {
    background: #a82222;
}

.ckm-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ========================================= */
/* MODAL                                     */
/* ========================================= */

.ckm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ckm-modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 28px 32px;
    min-width: 400px;
    max-width: 520px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.ckm-modal-close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.ckm-modal-close-btn:hover {
    color: #dc3232;
}

.ckm-modal-box h3 {
    margin: 0 0 16px;
    font-size: 20px;
}

.ckm-modal-domain-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

#ckm-paypal-button-container {
    margin-top: 16px;
}

/* Change Package List */
.ckm-change-pkg-list {
    margin-bottom: 16px;
}

.ckm-change-pkg-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #f9f9f9;
}

.ckm-change-pkg-option:hover {
    border-color: #0073aa;
    background: #f0f6fb;
}

.ckm-change-pkg-option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ckm-change-pkg-option-info strong {
    font-size: 15px;
}

.ckm-change-pkg-option-info span {
    font-size: 13px;
    color: #666;
}

.ckm-btn-small {
    padding: 6px 14px;
    font-size: 13px;
}

/* Manage Actions Row */
.ckm-manage-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* ========================================= */
/* STATUS & MESSAGES                         */
/* ========================================= */

.ckm-status-active  { color: #46b450; font-weight: 600; }
.ckm-status-inactive { color: #dc3232; font-weight: 600; }

.ckm-success {
    color: #46b450;
    font-weight: 600;
}

.ckm-error {
    color: #dc3232;
    font-weight: 600;
}

.ckm-info {
    color: #0073aa;
    font-style: italic;
}

.ckm-loading {
    color: #888;
    font-style: italic;
}

.ckm-contact-msg {
    background: #fff8e5;
    border: 1px solid #ffcc00;
    border-radius: 6px;
    padding: 16px 20px;
    margin-top: 12px;
}

.ckm-contact-msg a {
    color: #0073aa;
    text-decoration: underline;
}

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

@media (max-width: 600px) {
    .ckm-packages-grid {
        grid-template-columns: 1fr;
    }

    .ckm-modal-box {
        min-width: auto;
        margin: 16px;
        max-width: calc(100vw - 32px);
    }

    .ckm-manage-domain-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ckm-modal-domain-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ckm-input {
        min-width: auto;
        width: 100%;
    }
}
