* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
}

.demo-text {
    color: white;
    text-align: center;
    margin-top: 50px;
    font-size: 18px;
}

.popup-container {
    position: fixed;
    top: 50%;
    right: -350px;
    transform: translateY(-50%);
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px 0 0 12px;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
    transition: right 0.4s ease-out;
    z-index: 1000;
    overflow: visible;
    display: none; /* Hidden by default */
}

.popup-container.visible {
    display: block;
}

.popup-container.open {
    right: 0;
}

.popup-tab {
    position: absolute;
    left: -30px;
    top: 0;
    width: 30px;
    height: 30px;
    background: #4a90e2;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    box-shadow: -3px 0 15px rgba(0, 0, 0, 0.2);
    user-select: none;
    z-index: 1001;
}

.popup-tab::before {
    display: none;
}

.popup-tab::after {
    content: '◀';
    color: white;
    font-size: 14px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.popup-container.open .popup-tab::after {
    content: '▶';
}

.popup-tab:hover {
    background: #357abd;
}

.popup-tab:hover {
    background: #357abd;
    left: -58px;
}

.popup-tab::before {
    content: '●●●';
    color: white;
    font-size: 8px;
    line-height: 12px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.popup-tab::after {
    content: '◀';
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.popup-container.open .popup-tab::after {
    content: '▶';
}

.popup-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.tabs-container {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
}

.tab-button {
    flex: 1;
    padding: 15px 0;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-button.active {
    color: #4a90e2;
    background: linear-gradient(45deg, #e3f2fd, #f3e5f5);
}

.tab-button:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

.tab-content {
    padding: 18px;
    height: calc(100% - 115px);
    overflow-y: auto;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Score Tab Styles */
.score-header {
    text-align: center;
    margin-bottom: 20px;
}

.score-main {
    font-size: 48px;
    font-weight: bold;
    color: #4a90e2;
    margin-bottom: 10px;
}

.score-bar {
    width: 100%;
    height: 30px;
    border-radius: 15px;
    background: linear-gradient(90deg, #ff4444 0%, #ffaa44 50%, #44ff44 100%);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.score-indicator {
    position: absolute;
    top: -5px;
    width: 6px;
    height: 40px;
    background: #333;
    border-radius: 3px;
    transition: left 0.3s ease;
}

.score-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4a90e2;
}

.score-label {
    font-weight: 500;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
}

.score-value {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.chart-container {
    height: 120px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.chart-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Profile Tab Styles */
.profile-section {
    margin-bottom: 25px;
}

.profile-main-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 10px;
}

.profile-id {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.profile-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #4a90e2;
}

.profile-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 5px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.profile-value {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.interest-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.interest-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.interest-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.interest-item:last-child {
    border-bottom: none;
}

.interest-label {
    font-weight: 500;
    color: #555;
}

.interest-value {
    font-weight: 600;
    color: #4a90e2;
}

.interest-bars {
    margin-top: 15px;
}

.interest-bar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.interest-bar-label {
    width: 60px;
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.interest-bar-container {
    flex: 1;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 10px;
}

.interest-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.interest-bar-fill.high { background: #4a90e2; }
.interest-bar-fill.medium { background: #ff9800; }
.interest-bar-fill.low { background: #f44336; }

.loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 0;
}