/**
 * Nexus Connector — My Account styles.
 *
 * Card-based layout for downloads/licenses.
 *
 * @package Rymera_Nexus_Connector
 */

/* ==========================================================================
   License Cards
   ========================================================================== */

.nexus-license-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    background: #fff;
}

/* Top section */
.nexus-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 28px 28px;
    border-bottom: 1px solid #f0f0f0;
}

.nexus-card-top-left {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.nexus-card-top-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.nexus-card-label {
    font-size: 0.82em;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: block;
    margin-bottom: 4px;
}

.nexus-product-name {
    font-size: 1.45em;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
}

/* Download / Renew buttons */
.nexus-download-btn {
    display: inline-block;
    background: #4CAF50;
    color: #fff !important;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none !important;
    text-align: center;
    transition: background 0.2s;
}

.nexus-download-btn:hover {
    background: #43a047;
    color: #fff !important;
}

.nexus-renew-btn {
    display: inline-block;
    background: #e37400;
    color: #fff !important;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none !important;
    text-align: center;
    transition: background 0.2s;
}

.nexus-renew-btn:hover {
    background: #cc6800;
    color: #fff !important;
}

.nexus-version-text {
    font-size: 0.85em;
    color: #555;
    text-align: right;
}

.nexus-changelog-link {
    color: #0073aa !important;
    text-decoration: none;
}

.nexus-changelog-link:hover {
    text-decoration: underline;
}

/* Bottom section — 3-column grid */
.nexus-card-bottom {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
}

.nexus-card-col {
    padding: 16px 28px;
}

.nexus-card-col + .nexus-card-col {
    border-left: 1px solid #f0f0f0;
}

/* License key input + copy */
.nexus-license-key-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.nexus-license-key-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85em;
    width: calc(100% - 40px);
    background: #fafafa;
    color: #333;
    outline: none;
}

.nexus-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    vertical-align: middle;
    color: #666;
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.nexus-copy-btn:hover {
    border-color: #999;
    color: #333;
}

.nexus-copy-btn .nexus-check-icon {
    display: none;
    color: #4CAF50;
}

.nexus-copy-btn.copied .nexus-copy-icon {
    display: none;
}

.nexus-copy-btn.copied .nexus-check-icon {
    display: inline;
}

.nexus-copy-btn.copied {
    border-color: #4CAF50;
    color: #4CAF50;
}

/* Activations */
.nexus-activations-text {
    font-size: 0.95em;
    color: #333;
}

.nexus-view-sites-link {
    color: #0073aa !important;
    text-decoration: none;
}

.nexus-view-sites-link:hover {
    text-decoration: underline;
}

/* Renewal */
.nexus-renewal-text {
    font-size: 0.95em;
    color: #333;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.nexus-renew-link {
    color: #0073aa !important;
    text-decoration: none;
    font-size: 0.9em;
}

.nexus-renew-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Status Badges
   ========================================================================== */

.nexus-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.4;
    white-space: nowrap;
}

.nexus-status--active {
    background: #e6f4ea;
    color: #1e7e34;
}

.nexus-status--expired,
.nexus-status--cancelled {
    background: #fce8e6;
    color: #c5221f;
}

.nexus-status--suspended,
.nexus-status--on-hold,
.nexus-status--pending-cancel {
    background: #fef7e0;
    color: #e37400;
}

.nexus-status--pending {
    background: #e8eaed;
    color: #5f6368;
}

.nexus-status--lifetime {
    background: #e8f0fe;
    color: #1a73e8;
}

/* Expired date */
.nexus-expired-date {
    color: #c5221f;
    font-weight: 600;
}

/* ==========================================================================
   Type Badges (Production / Staging)
   ========================================================================== */

.nexus-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
}

.nexus-type-badge--production {
    background: #e8f0fe;
    color: #1a73e8;
}

.nexus-type-badge--staging {
    background: #e8eaed;
    color: #5f6368;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.nexus-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nexus-modal {
    background: #fafafa;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    padding: 24px;
    position: relative;
}

.nexus-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
    line-height: 1;
}

.nexus-modal-close:hover {
    color: #333;
}

.nexus-modal-body h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

/* Sites table in modal */
.nexus-sites-modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.nexus-sites-modal-table th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    color: #555;
}

.nexus-sites-modal-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}

.nexus-deactivate-site-btn {
    background: none;
    border: 1px solid #c5221f;
    color: #c5221f;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

.nexus-deactivate-site-btn:hover {
    background: #c5221f;
    color: #fff;
}

/* Changelog in modal */
.nexus-changelog-body {
    max-height: 500px;
    overflow: auto;
    font-size: 0.95em;
    line-height: 1.6;
}

.nexus-changelog-body h4 {
    margin: 16px 0 8px;
}

.nexus-changelog-body ul {
    margin: 0 0 12px 20px;
}

/* ==========================================================================
   Back link / misc (shared with manage-sites page)
   ========================================================================== */

.nexus-back-link {
    margin-top: 20px;
}

.nexus-license-info {
    margin-bottom: 20px;
}

/* Deactivate form — inline (manage-sites page) */
.nexus-deactivate-form {
    display: inline;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 768px) {

    .nexus-card-top {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }

    .nexus-card-top-right {
        align-items: flex-start;
    }

    .nexus-card-bottom {
        grid-template-columns: 1fr;
    }

    .nexus-card-col + .nexus-card-col {
        border-left: none;
        border-top: 1px solid #f0f0f0;
    }

    .nexus-card-col {
        padding: 14px 20px;
    }

    .nexus-license-key-input {
        width: calc(100% - 44px);
        font-size: 0.78em;
    }
}
