/* =========================================================
   USER PROFILE / DASHBOARD PAGE STYLES
========================================================= */

.profile-page {
    --pf-primary:       #0047ff;
    --pf-primary-dark:  #0038c7;
    --pf-primary-light: #eff4ff;
    --pf-success:       #16a34a;
    --pf-success-light: #dcfce7;
    --pf-dark:          #0f172a;
    --pf-text:          #334155;
    --pf-muted:         #64748b;
    --pf-border:        #e2e8f0;
    --pf-bg:            #f8fafc;
    --pf-card:          #ffffff;
    --pf-radius:        16px;

    width: 100%;
    min-height: 85vh;
    background: var(--pf-bg);
    padding-bottom: 80px;
}

.profile-container {
    width: min(1140px, calc(100% - 40px));
    margin: 0 auto;
}

/* HERO HEADER */
.profile-hero {
    background: linear-gradient(110deg, #0b1733 0%, #102b63 50%, #1d4ed8 100%);
    padding: 48px 0 54px;
    color: white;
    position: relative;
    overflow: hidden;
}

.profile-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.profile-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.profile-user-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #ffffff;
    flex-shrink: 0;
}

.profile-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(22, 163, 74, 0.25);
    border: 1px solid rgba(22, 163, 74, 0.5);
    color: #86efac;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.profile-user-info h1 {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 6px;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.profile-user-info p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.profile-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.profile-logout-btn:hover {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 1);
    color: white;
    text-decoration: none;
}

/* MAIN LAYOUT */
.profile-main-layout {
    margin-top: 36px;
}

/* STATS GRID */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.profile-stat-card {
    background: var(--pf-card);
    border: 1px solid var(--pf-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.blue { background: #eff4ff; color: #0047ff; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.purple { background: #f3e8ff; color: #9333ea; }
.stat-icon.gold { background: #fef9c3; color: #ca8a04; }

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.stat-label {
    font-size: 12px;
    color: var(--pf-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--pf-dark);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.text-mono {
    font-family: monospace;
    font-size: 14px;
}

/* DASHBOARD GRID */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.profile-card {
    background: var(--pf-card);
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.profile-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--pf-border);
    background: #fafbfc;
}

.profile-card-header h2 {
    font-size: 17px;
    font-weight: 800;
    color: var(--pf-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-card-header h2 i {
    color: var(--pf-primary);
}

.profile-card-body {
    padding: 24px;
}

.profile-card-body.p-0 {
    padding: 0;
}

/* LICENSE BOX */
.license-box {
    background: var(--pf-primary-light);
    border: 1.5px solid rgba(0, 71, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.license-box-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--pf-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 10px;
}

.license-key-wrap {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.license-key-wrap input {
    flex: 1;
    height: 44px;
    border: 1px solid rgba(0, 71, 255, 0.3);
    border-radius: 8px;
    background: white;
    padding: 0 14px;
    font-family: monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--pf-dark);
    letter-spacing: 1px;
}

.copy-key-btn {
    height: 44px;
    padding: 0 18px;
    background: var(--pf-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease;
}

.copy-key-btn:hover {
    background: var(--pf-primary-dark);
}

.license-hint {
    font-size: 12px;
    color: var(--pf-muted);
    margin: 0;
    line-height: 1.5;
}

/* SOFTWARE DOWNLOAD BOX */
.software-download-box {
    border: 1px solid var(--pf-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #ffffff;
}

.software-info h4 {
    font-size: 15px;
    font-weight: 800;
    color: var(--pf-dark);
    margin: 0 0 4px;
}

.software-info p {
    font-size: 12px;
    color: var(--pf-muted);
    margin: 0;
}

.profile-download-btn {
    padding: 10px 18px;
    background: var(--pf-success);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.profile-download-btn:hover {
    background: #15803d;
    color: white;
    text-decoration: none;
}

/* TABLE STYLES */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.profile-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.profile-table th {
    background: #f8fafc;
    color: var(--pf-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--pf-border);
}

.profile-table td {
    padding: 16px 20px;
    color: var(--pf-text);
    border-bottom: 1px solid var(--pf-border);
}

.profile-table tr:last-child td {
    border-bottom: none;
}

.badge-success {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.badge-muted {
    display: inline-block;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

@media (max-width: 992px) {
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .profile-hero-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .profile-stats-grid {
        grid-template-columns: 1fr;
    }
    .software-download-box {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* API ERROR NOTICE */
.profile-api-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fefce8;
    border: 1px solid #fde047;
    color: #854d0e;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* BADGE WARNING */
.badge-warning {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef9c3;
    color: #854d0e;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

/* ACCOUNT DETAILS CARD */
.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.profile-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--pf-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--pf-dark);
    word-break: break-all;
}

@media (max-width: 600px) {
    .profile-details-grid {
        grid-template-columns: 1fr;
    }
}
