/**
 * Qognetix Portal Styles
 */

/* Portal Layout */
.qog-portal-wrapper {
    min-height: 60vh;
    padding: 20px;
}

.qog-portal-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Portal Header */
.qog-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 30px;
}

.qog-portal-title {
    font-size: 28px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.qog-portal-title .dashicons {
    color: #2271b1;
}

.portal-welcome {
    margin: 0;
}

.portal-welcome .license-status {
    color: #00a32a;
    font-weight: 500;
}

.portal-welcome-products {
    margin-top: 15px;
}

.portal-welcome-products h4 {
    margin-bottom: 10px;
    font-size: 14px;
    color: #646970;
}

.portal-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-product-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #2271b1;
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* LAB product badges */
.portal-product-badge-lab {
    background: #2271b1;
}

/* SSE product badges */
.portal-product-badge-sse {
    background: #00a32a;
}

/* Product type sections in welcome widget */
.portal-welcome-product-type {
    margin-bottom: 15px;
}

.portal-welcome-product-lab .portal-product-list-inline {
    color: #2271b1;
}

.portal-welcome-product-sse .portal-product-list-inline {
    color: #00a32a;
}

.portal-welcome-products ul {
    margin: 0;
    padding-left: 20px;
}

.portal-welcome-products li {
    margin: 5px 0;
}

/* Portal Navigation */
.qog-portal-nav {
    margin-bottom: 30px;
}

.portal-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-menu li a {
    display: inline-block;
    padding: 10px 20px;
    background: #f0f0f1;
    border-radius: 4px;
    text-decoration: none;
    color: #1d2327;
    transition: all 0.2s;
}

.portal-menu li a:hover {
    background: #e0e0e1;
}

.portal-menu li.active a {
    background: #2271b1;
    color: #fff;
}

/* Vertical Menu Layout */
.portal-menu-vertical {
    display: inline-block;
}

.portal-menu-vertical ul {
    flex-direction: column;
    gap: 5px;
}

.portal-menu-vertical li a {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* Portal Content */
.qog-portal-content {
    padding: 20px 0;
}

.qog-portal-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Dashboard Cards */
.qog-portal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.qog-portal-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.qog-portal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.qog-portal-card h3 {
    margin-top: 0;
    color: #1d2327;
}

.qog-portal-card p {
    color: #646970;
    margin-bottom: 15px;
}

/* Downloads Table */
.portal-downloads-section {
    margin-bottom: 40px;
}

.portal-downloads-section h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.portal-downloads-lab h3 {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

.portal-downloads-sse h3 {
    color: #00a32a;
    border-bottom-color: #00a32a;
}

.portal-downloads-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.portal-downloads-table th,
.portal-downloads-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.portal-downloads-table th {
    background: #f6f7f7;
    font-weight: 600;
    color: #1d2327;
}

.portal-downloads-table tr:hover {
    background: #f9f9f9;
}

.portal-downloads-table .unavailable {
    color: #b32d2e;
    font-style: italic;
}

.portal-download-btn {
    position: relative;
}

.portal-download-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.portal-download-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: qog-spin 0.6s linear infinite;
}

@keyframes qog-spin {
    to { transform: rotate(360deg); }
}

/* License Info Table */
.portal-license-table {
    width: 100%;
    max-width: 600px;
    border-collapse: collapse;
    margin-top: 20px;
}

.portal-license-table th {
    padding: 12px 15px;
    text-align: left;
    background: #f6f7f7;
    font-weight: 600;
    color: #1d2327;
    width: 150px;
}

.portal-license-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

/* Release Notes */
.qog-release-notes {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.qog-release-note {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #2271b1;
}

.qog-release-note h3 {
    margin-top: 0;
    margin-bottom: 5px;
}

.qog-release-meta {
    color: #646970;
    font-size: 14px;
    margin-bottom: 15px;
}

.qog-release-content {
    line-height: 1.6;
}

.qog-release-content .button {
    display: inline-block;
    margin-top: 10px;
}

/* Loading Overlay */
.qog-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.qog-loading-overlay::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: qog-spin 0.8s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .qog-portal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .portal-menu ul {
        flex-direction: column;
    }

    .portal-menu li a {
        display: block;
        text-align: center;
    }

    .portal-downloads-table,
    .portal-license-table {
        display: block;
        overflow-x: auto;
    }

    .qog-portal-cards {
        grid-template-columns: 1fr;
    }
}

/* Elementor Widget Styles */
.qog-portal-unauthorized {
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #d63638;
    text-align: center;
}

.qog-portal-login-message {
    background: #fff;
    border-left: 4px solid #2271b1;
    text-align: center;
}

.qog-portal-protected-content {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
}

/* Multi-License Layouts */
.portal-license-product-group {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 4px solid #2271b1;
}

/* LAB product group styling */
.portal-license-group-lab {
    border-left-color: #2271b1; /* Blue */
}

.portal-license-group-lab h3 {
    color: #2271b1;
}

/* SSE product group styling */
.portal-license-group-sse {
    border-left-color: #00a32a; /* Green */
}

.portal-license-group-sse h3 {
    color: #00a32a;
}

/* Other product group styling */
.portal-license-group-other {
    border-left-color: #646970; /* Gray */
}

.portal-license-group-other h3 {
    color: #646970;
}

.portal-license-product-group h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #1d2327;
}

.portal-license-count {
    margin-top: 10px;
    font-size: 14px;
    color: #646970;
    font-style: italic;
}

.portal-license-multi-table {
    margin-top: 20px;
}

.portal-license-multi-table th {
    background: #f6f7f7;
}

.portal-license-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.portal-license-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.portal-license-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2271b1;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.portal-license-card .portal-license-table {
    margin-top: 0;
}

.portal-license-card .portal-license-table th {
    width: 120px;
    padding: 8px;
    background: transparent;
    font-weight: 600;
}

.portal-license-card .portal-license-table td {
    padding: 8px;
}

@media (max-width: 768px) {
    .portal-license-cards {
        grid-template-columns: 1fr;
    }

    .portal-license-multi-table {
        display: block;
        overflow-x: auto;
    }
}
