/* DowGold License Manager - Frontend Styles v1.2.6 */

/*
 * WooCommerce normally reserves a desktop sidebar for these links.  The
 * Account Hub needs that width, so the six destination links become a 3x2
 * navigation grid above the content. The final destination cell is divided
 * between Account details and a compact Log out companion.
 */
body.woocommerce-account .woocommerce {
    box-sizing: border-box;
    clear: both;
    container-name: dglm-account-shell;
    container-type: inline-size;
    display: block !important;
    max-width: 100% !important;
    min-width: 0;
    width: 100% !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation {
    clear: both !important;
    float: none !important;
    margin: 0 0 18px !important;
    max-width: none !important;
    min-width: 0;
    width: 100% !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation > ul {
    display: grid !important;
    gap: 9px !important;
    grid-auto-flow: row !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation > ul > li {
    border: 0 !important;
    clear: none !important;
    float: none !important;
    grid-column: span 4 !important;
    grid-row: auto !important;
    list-style: none !important;
    margin: 0 !important;
    max-width: none !important;
    min-width: 0;
    order: initial !important;
    padding: 0 !important;
    width: auto !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation > ul > li > a {
    align-items: center;
    background: #0d0d0f;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    box-sizing: border-box;
    color: #f2f2f3;
    display: flex !important;
    font-weight: 700;
    height: 100%;
    justify-content: center;
    line-height: 1.25;
    min-height: 48px;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 10px 14px;
    text-align: center;
    text-decoration: none !important;
    width: 100% !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation > ul > li > a:hover {
    background: rgba(245, 197, 66, .08);
    border-color: rgba(245, 197, 66, .28);
    color: #fff;
}

body.woocommerce-account .woocommerce-MyAccount-navigation > ul > li.is-active > a {
    background: rgba(201, 145, 16, .2);
    border-color: rgba(245, 197, 66, .6);
    color: #f5c542;
}

body.woocommerce-account .woocommerce-MyAccount-navigation > ul > li > a:focus-visible {
    box-shadow: 0 0 0 3px rgba(245, 197, 66, .2);
    outline: 1px solid #f5c542;
    outline-offset: 1px;
}

/* Split the final destination cell 3:1 between Account details and Log out. */
html body.woocommerce-account .woocommerce
.woocommerce-MyAccount-navigation > ul >
li.woocommerce-MyAccount-navigation-link.woocommerce-MyAccount-navigation-link--edit-account {
    grid-column: span 3 !important;
    grid-row: auto !important;
    order: initial !important;
}

html body.woocommerce-account .woocommerce
.woocommerce-MyAccount-navigation > ul >
li.woocommerce-MyAccount-navigation-link.woocommerce-MyAccount-navigation-link--customer-logout {
    align-self: stretch !important;
    grid-column: span 1 !important;
    grid-row: auto !important;
    justify-self: stretch !important;
    order: initial !important;
    width: auto !important;
}

html body.woocommerce-account .woocommerce
.woocommerce-MyAccount-navigation > ul >
li.woocommerce-MyAccount-navigation-link.woocommerce-MyAccount-navigation-link--customer-logout > a {
    background: #0d0d0f !important;
    border: 1px solid rgba(255, 255, 255, .1) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    color: #9a9ca7 !important;
    display: flex !important;
    font-size: 12px;
    font-weight: 700;
    height: 100% !important;
    justify-content: center !important;
    line-height: 1.25;
    min-height: 48px !important;
    padding: 10px 8px !important;
    text-align: center;
    text-decoration: none !important;
    width: 100% !important;
}

html body.woocommerce-account .woocommerce
.woocommerce-MyAccount-navigation > ul >
li.woocommerce-MyAccount-navigation-link.woocommerce-MyAccount-navigation-link--customer-logout > a:hover {
    background: rgba(245, 197, 66, .08) !important;
    border-color: rgba(245, 197, 66, .28) !important;
    color: #f5c542 !important;
    text-decoration: none !important;
}

html body.woocommerce-account .woocommerce
.woocommerce-MyAccount-navigation > ul >
li.woocommerce-MyAccount-navigation-link.woocommerce-MyAccount-navigation-link--customer-logout > a:focus-visible {
    background: rgba(245, 197, 66, .08) !important;
    border-color: rgba(245, 197, 66, .5) !important;
    box-shadow: 0 0 0 2px rgba(245, 197, 66, .2) !important;
    color: #fff !important;
    outline: 1px solid #f5c542 !important;
    outline-offset: 2px !important;
    text-decoration: none !important;
}

body.woocommerce-account .woocommerce-MyAccount-content {
    clear: both !important;
    float: none !important;
    margin: 0 !important;
    max-width: none !important;
    min-width: 0;
    width: 100% !important;
}

body.woocommerce-account .woocommerce-MyAccount-content .dglm-licenses-wrapper {
    max-width: none;
    width: 100%;
}

@container dglm-account-shell (max-width: 640px) {
    body.woocommerce-account .woocommerce-MyAccount-navigation > ul {
        grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    }
}

@container dglm-account-shell (max-width: 420px) {
    body.woocommerce-account .woocommerce-MyAccount-navigation > ul {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

/* Viewport fallbacks for older browsers without container-query support. */
@supports not (container-type: inline-size) {
    @media (max-width: 760px) {
        body.woocommerce-account .woocommerce-MyAccount-navigation > ul {
            grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
        }
    }

    @media (max-width: 480px) {
        body.woocommerce-account .woocommerce-MyAccount-navigation > ul {
            grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        }
    }
}

.dglm-licenses-wrapper {
    max-width: 800px;
}

.dglm-licenses-wrapper h2 {
    margin-bottom: 0.5em;
}

.dglm-licenses-wrapper > p {
    color: #666;
    margin-bottom: 2em;
}

/* License Card */
.dglm-license-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    color: #fff;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.dglm-license-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #333;
}

.dglm-license-key .label {
    display: block;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.dglm-license-key code {
    font-size: 14px;
    background: #000;
    padding: 6px 12px;
    border-radius: 6px;
    color: #4ade80;
    font-family: 'Monaco', 'Consolas', monospace;
    display: inline-block;
}

.dglm-license-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dglm-tier,
.dglm-status {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.dglm-tier-lifetime {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
}

.dglm-tier-annual {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.dglm-tier-budget {
    background: #444;
    color: #fff;
}

.dglm-tier-monthly {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
}

.dglm-status-active {
    background: #4ade80;
    color: #000;
}

.dglm-status-expired {
    background: #ef4444;
    color: #fff;
}

.dglm-status-suspended {
    background: #f59e0b;
    color: #000;
}

/* License Info */
.dglm-license-info {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.dglm-info-item {
    font-size: 14px;
    color: #ccc;
}

.dglm-info-item strong {
    color: #888;
    font-weight: 500;
}

/* Accounts Section */
.dglm-accounts-section {
    background: #000;
    border-radius: 8px;
    padding: 20px;
}

.dglm-accounts-section h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #fff;
    font-weight: 600;
}

.dglm-accounts-help {
    font-size: 13px;
    color: #888;
    margin: 0 0 16px 0;
}

.dglm-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.dglm-account-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dglm-account-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    color: #fff;
    font-family: 'Monaco', 'Consolas', monospace;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dglm-account-input:focus {
    outline: none;
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

.dglm-account-input::placeholder {
    color: #555;
}

.dglm-remove-account {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dglm-remove-account:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

/* Buttons */
.dglm-add-account {
    background: transparent;
    border: 1px dashed #444;
    color: #888;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.dglm-add-account:hover {
    border-color: #4ade80;
    color: #4ade80;
}

.dglm-accounts-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #222;
}

.dglm-save-accounts {
    background: #4ade80 !important;
    color: #000 !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.dglm-save-accounts:hover {
    background: #22c55e !important;
    transform: translateY(-1px);
}

.dglm-save-accounts:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    transform: none;
}

.dglm-save-status {
    font-size: 14px;
    font-weight: 500;
}

.dglm-save-status.success {
    color: #4ade80;
}

.dglm-save-status.error {
    color: #ef4444;
}

/* Lifetime Upgrade Box */
.dglm-upgrade-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(217, 119, 6, 0.06));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 0 0 20px 0;
}

.dglm-upgrade-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dglm-upgrade-copy strong {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.dglm-upgrade-copy span {
    color: #b8b8b8;
    font-size: 13px;
    line-height: 1.45;
}

.dglm-upgrade-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.dglm-upgrade-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000 !important;
    border-radius: 7px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none !important;
    transition: transform 0.2s, filter 0.2s;
}

.dglm-upgrade-button-vip {
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.28) inset;
}

.dglm-upgrade-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

/* Messages */
.dglm-error {
    background: #1a1a1a;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 16px;
    border-radius: 8px;
}

.dglm-no-licenses {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #888;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
}

.dglm-loading {
    color: #888;
    text-align: center;
    padding: 40px;
}

/* Responsive */
@media (max-width: 600px) {
    .dglm-license-card {
        padding: 16px;
    }

    .dglm-license-header {
        flex-direction: column;
    }

    .dglm-license-info {
        flex-direction: column;
        gap: 8px;
    }

    .dglm-license-key code {
        font-size: 12px;
        word-break: break-all;
    }

    .dglm-accounts-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .dglm-save-accounts {
        width: 100%;
    }

    .dglm-upgrade-box {
        flex-direction: column;
        align-items: stretch;
    }

    .dglm-upgrade-actions {
        width: 100%;
        justify-content: stretch;
    }

    .dglm-upgrade-button {
        width: 100%;
    }
}
