/**
 * Base47 Customer Portal Styles
 * 
 * @package Base47_Core
 * @since 1.3.0
 */

/* Global Portal Styles */
:root {
    --primary: #ff4d00;
    --gradient-orange: linear-gradient(135deg, #ff4d00 0%, #ff8c42 100%);
    --soft-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.base47-portal-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Hide theme elements that interfere */
body.page .site-content {
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

/* Hide ALL theme content except our forms */
body.page .site-content > *:not(.entry-content),
body.page .site-content .entry-content > *:not(.base47-login-section):not(.base47-register-section):not(.base47-dashboard):not(.base47-account-section) {
    display: none !important;
}

/* Hide theme sidebars and extra content on portal pages */
body.page-template-default .sidebar,
body.page .widget-area,
body.page aside,
body.page .site-aside,
body.page [class*="sidebar"],
body.page [class*="widget"],
body.page .site-header,
body.page .site-footer {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Make content full width on portal pages */
body.page .site-content .content-area,
body.page .site-content main,
body.page .site-content article,
body.page .site-content .entry-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Override theme background */
body.page {
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%) !important;
}

body.page .site-content {
    background: transparent !important;
}

/* Hide any floating elements */
body.page *:not(.base47-login-section):not(.base47-register-section):not(.base47-dashboard):not(.base47-account-section) {
    position: static !important;
}

body.page [style*="position: absolute"],
body.page [style*="position: fixed"] {
    display: none !important;
}

/* Force white text on dashboard */
.base47-dashboard * {
    color: inherit;
}

.base47-dashboard h1,
.base47-dashboard h2,
.base47-dashboard h3 {
    color: #ffffff !important;
}

.base47-dashboard p {
    color: #e0e0e0 !important;
}

/* Dashboard Styles */
.base47-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dashboard-welcome {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-welcome-content {
    flex: 1;
}

.dashboard-welcome h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff !important;
}

.dashboard-welcome p {
    font-size: 18px;
    color: #e0e0e0 !important;
}

.dashboard-logout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.dashboard-logout-btn:hover {
    background: rgba(255, 77, 0, 0.2);
    border-color: var(--primary);
    color: white;
    text-decoration: none;
}

/* Stats Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--soft-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8dc 100%);
    border-radius: 12px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Dashboard Sections */
.dashboard-section {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--soft-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 32px;
}

.dashboard-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #1a1a1a;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state p {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

.btn-primary {
    background: var(--gradient-orange);
    color: white;
    padding: 12px 32px;
    border-radius: 12px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 77, 0, 0.3);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 77, 0, 0.4);
    color: white;
    text-decoration: none;
}

/* Licenses Grid */
.licenses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.license-card {
    background: #fafafa;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e0e0e0;
}

.license-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.license-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.license-status {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.license-status.status-active {
    background: #d4edda;
    color: #155724;
}

.license-status.status-expired {
    background: #f8d7da;
    color: #721c24;
}

.license-status.status-suspended {
    background: #fff3cd;
    color: #856404;
}

.license-body {
    margin-bottom: 20px;
}

.license-key {
    margin-bottom: 16px;
}

.license-key label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.key-display {
    display: flex;
    gap: 8px;
    align-items: center;
}

.key-display code {
    flex: 1;
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    overflow-x: auto;
}

.license-info {
    display: grid;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.info-item .label {
    color: #666;
    font-weight: 500;
}

.info-item .value {
    color: #1a1a1a;
    font-weight: 600;
}

.license-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.btn-download,
.btn-renew {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-download {
    background: var(--gradient-orange);
    color: white;
    border: none;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 77, 0, 0.3);
    color: white;
    text-decoration: none;
}

.btn-renew {
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-renew:hover {
    background: var(--primary);
    color: white;
    text-decoration: none;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.action-card {
    background: #fafafa;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
    text-decoration: none;
}

.action-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8dc 100%);
    border-radius: 10px;
    flex-shrink: 0;
}

.action-content h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1a1a1a;
}

.action-content p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Copy Button for License Keys */
.copy-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 600;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.copy-btn.copied {
    background: #2dce89;
    color: white;
    border-color: #2dce89;
}

/* Loading States */
.base47-loading {
    opacity: 0.6;
    pointer-events: none;
}

.base47-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .licenses-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .dashboard-welcome h1 {
        font-size: 28px;
    }
    
    .dashboard-section {
        padding: 20px;
    }
}

/* Print Styles */
@media print {
    .btn-primary,
    .copy-btn,
    .quick-actions,
    .license-actions {
        display: none;
    }
}
