/* WooCommerce License Manager - Structural Layout Only (All Styles and Font Sizes Inherited from Active Theme) */

.lm-dashboard-container {
    direction: rtl;
    text-align: right;
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.lm-dashboard-container *,
.lm-dashboard-container *::before,
.lm-dashboard-container *::after {
    box-sizing: border-box;
    font-family: inherit !important;
    font-size: inherit !important;
}

.lm-dashboard-title {
    color: inherit;
    font-family: inherit !important;
    font-size: inherit !important;
    margin: 0 0 0.5rem 0;
}

.lm-dashboard-subtitle {
    color: inherit;
    font-family: inherit !important;
    font-size: inherit !important;
    opacity: 0.8;
    margin: 0 0 2rem 0;
}

/* Dashboard Tabbed Layout */
.lm-dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr; /* Sidebar tabs on desktop */
    gap: 2rem;
    width: 100% !important;
    max-width: 100% !important;
}

/* Sidebar Tab list */
.lm-tabs-navigation {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-self: start;
}

.lm-tab-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: 1px solid currentColor;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: right;
    opacity: 0.7;
    transition: opacity 150ms ease, border-width 150ms ease, transform 100ms cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    width: 100%;
}

.lm-tab-btn:hover {
    opacity: 0.9;
}

.lm-tab-btn.lm-active {
    opacity: 1;
    border-width: 2px;
    font-weight: bold;
}

/* Emil Kowalski active scaling press feedback */
.lm-tab-btn:active {
    transform: scale(0.97);
}

.lm-tab-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: flex-start;
}

.lm-tab-title {
    font-weight: bold;
    color: inherit;
}

.lm-tab-key {
    font-family: monospace;
    font-size: 0.85em !important;
    opacity: 0.7;
    direction: ltr;
}

.lm-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.lm-status-dot.lm-status-active {
    background-color: #10b981;
}

.lm-status-dot.lm-status-expired {
    background-color: #ef4444;
}

.lm-status-dot.lm-status-inactive {
    background-color: #6b7280;
}

/* Panes Container */
.lm-panes-container {
    flex-grow: 1;
    min-width: 0;
}

.lm-license-card {
    display: none; /* Hidden by default */
    background: inherit;
    border: inherit;
    border-radius: inherit;
    padding: 1.5rem;
    box-shadow: inherit;
    grid-template-columns: 1fr 1fr; /* Two columns side-by-side in desktop */
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    opacity: 0;
}

/* Slide up scale reveal animation on active tab switcher */
.lm-license-card.lm-active {
    display: grid;
    animation: lm-fade-in 200ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes lm-fade-in {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.lm-card-header {
    grid-column: 1 / -1; /* Spans full width */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.lm-order-badge {
    background: transparent;
    color: inherit;
    border: 1px solid currentColor;
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: inherit !important;
}

.lm-status-badge {
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border: 1px solid currentColor;
    font-size: inherit !important;
}

.lm-status-active {
    color: #10b981;
}

.lm-status-expired {
    color: #ef4444;
}

.lm-status-inactive {
    color: #6b7280;
}

.lm-key-wrapper {
    grid-column: 1; /* Left Column */
    grid-row: 2;
    margin-bottom: 0;
}

.lm-label {
    display: block;
    font-weight: bold;
    color: inherit;
    margin-bottom: 0.5rem;
    font-size: inherit !important;
}

.lm-key-input-group {
    display: flex;
    align-items: center;
    border: 1px solid currentColor;
    border-radius: 4px;
    background: inherit;
    overflow: visible !important;
}

.lm-key-input {
    flex-grow: 1;
    border: none !important;
    background: transparent !important;
    font-family: monospace !important;
    padding: 0.5rem 0.75rem !important;
    color: inherit !important;
    box-shadow: none !important;
    width: 100%;
    cursor: pointer;
    text-align: left;
    direction: ltr;
    height: auto !important;
    font-size: inherit !important;
}

.lm-copy-btn {
    border: none !important;
    background: transparent !important;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    color: inherit !important;
    border-right: 1px solid currentColor !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: none !important;
    border-radius: 0 !important;
    height: auto !important;
    font-size: inherit !important;
}

/* Tooltip style - keeps absolute unit to prevent scaling conflicts */
.lm-copy-btn .tooltip-text {
    visibility: hidden;
    width: 80px;
    background-color: #000;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 4px 0;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    margin-left: -40px;
    opacity: 0;
    transition: opacity 150ms ease;
    font-size: 11px !important;
    pointer-events: none;
}

.lm-copy-btn .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #000 transparent transparent transparent;
}

.lm-copy-btn.copied .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.lm-card-details {
    grid-column: 1; /* Left Column below key wrapper */
    grid-row: 3;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0;
    margin-bottom: 0;
    border-top: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    opacity: 0.9;
    align-self: start;
}

.lm-detail-item {
    display: flex;
    justify-content: space-between;
    font-size: inherit !important;
}

.lm-detail-label {
    color: inherit;
}

.lm-detail-value {
    font-weight: bold;
    color: inherit;
}

.lm-text-danger {
    color: #ef4444;
}

.lm-domains-section {
    grid-column: 2; /* Right Column in desktop */
    grid-row: 2 / 4; /* Spans rows 2 and 3 next to key and details */
    margin-top: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.lm-domains-list {
    list-style: none !important;
    list-style-type: none !important;
    padding: 0 !important;
    margin: 0 0 1rem 0 !important;
    max-height: 200px;
    overflow-y: auto;
}

.lm-domains-list li,
.lm-domain-item {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 0 0.5rem 0 !important;
}

.lm-domains-list li::before,
.lm-domain-item::before {
    content: none !important;
    display: none !important;
}

.lm-domain-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border: 1px solid currentColor;
    border-radius: 4px;
    background: inherit;
    font-size: inherit !important;
}

.lm-domain-name {
    color: inherit;
    font-family: monospace;
    direction: ltr;
}

.lm-remove-domain-btn {
    background: transparent !important;
    border: none !important;
    color: inherit !important;
    cursor: pointer;
    padding: 0.25rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    opacity: 0.7;
    transition: opacity 150ms ease;
}

.lm-remove-domain-btn:hover {
    opacity: 1;
}

.lm-no-domains-placeholder {
    padding: 1rem;
    text-align: center;
    color: inherit;
    opacity: 0.7;
    font-style: italic;
    border: 1px dashed currentColor;
    border-radius: 4px;
    list-style-type: none !important;
    font-size: inherit !important;
}

.lm-add-domain-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.lm-new-domain-input {
    flex-grow: 1;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid currentColor !important;
    border-radius: 4px !important;
    direction: ltr;
    text-align: left;
    box-shadow: none !important;
    background: inherit !important;
    color: inherit !important;
    height: auto !important;
    font-size: inherit !important;
}

.lm-add-domain-btn {
    background: transparent !important;
    color: inherit !important;
    border: 1px solid currentColor !important;
    border-radius: 4px !important;
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    padding: 0 !important;
    flex-shrink: 0;
    box-shadow: none !important;
    opacity: 0.8;
    transition: opacity 150ms ease;
}

.lm-add-domain-btn:hover:not(:disabled) {
    opacity: 1;
}

.lm-add-domain-btn:disabled,
.lm-new-domain-input:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed;
}

.lm-feedback-msg {
    min-height: 1.2rem;
    margin: 0;
    line-height: 1.2;
    font-size: inherit !important;
}

.lm-feedback-msg.success {
    color: #10b981;
}

.lm-feedback-msg.error {
    color: #ef4444;
}

/* Alert Boxes */
.lm-unauthorized-alert,
.lm-no-licenses-alert {
    direction: rtl;
    text-align: right;
    padding: 1rem;
    border: 1px solid currentColor;
    border-radius: 4px;
    color: inherit;
    margin: 1.5rem 0;
    font-size: inherit !important;
}

.lm-unauthorized-alert a {
    color: inherit;
    text-decoration: underline;
    font-weight: bold;
}

/* Loading state for card */
.lm-license-card.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: wait;
}

/* Scrollbar customization */
.lm-domains-list::-webkit-scrollbar {
    width: 6px;
}

.lm-domains-list::-webkit-scrollbar-track {
    background: transparent;
}

.lm-domains-list::-webkit-scrollbar-thumb {
    background-color: currentColor;
    opacity: 0.3;
    border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lm-dashboard-layout {
        grid-template-columns: 1fr; /* Stack sidebar and pane vertically */
        gap: 1.5rem;
    }
    
    .lm-tabs-navigation {
        flex-direction: row; /* Horizontal tabs bar on mobile */
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        border-bottom: 1px solid currentColor;
    }
    
    .lm-tab-btn {
        width: auto;
        flex: 0 0 auto;
        padding: 0.5rem 1rem;
        margin-left: 0.5rem;
        border-bottom: none;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    
    .lm-tab-btn.lm-active {
        border-bottom: 2px solid transparent;
        background: rgba(0, 0, 0, 0.05);
    }
    
    .lm-tab-status {
        margin-right: 0.25rem;
    }
    
    .lm-license-card {
        grid-template-columns: 1fr; /* Stack inner card columns on mobile */
        gap: 1.25rem;
    }
    
    .lm-key-wrapper,
    .lm-card-details,
    .lm-domains-section {
        grid-column: auto;
        grid-row: auto;
    }
}
