* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.profile-nav {
    margin-bottom: 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    transition: background 0.2s;
}

.back-link:hover {
    background: rgba(255,255,255,0.3);
}

.loading, .empty-profile, .error-state {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.profile-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    padding: 40px;
    border-bottom: 1px solid #e8ecf4;
}

.header-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.category-badge {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

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

/* Credit badges */
.credit-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.credit-badge.credit-low {
    background: #d1fae5;
    color: #065f46;
}

.credit-badge.credit-medium {
    background: #fef3c7;
    color: #92400e;
}

.credit-badge.credit-high {
    background: #fee2e2;
    color: #991b1b;
}

/* Credit info box in overview */
.credit-info-box {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.credit-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.credit-icon {
    font-size: 1.5rem;
}

.credit-explanation {
    color: #6b7280;
    font-size: 0.9rem;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.profile-header h1 {
    font-size: 2rem;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.tagline {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 16px;
}

.roles-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.role-badge {
    background: #e8f4f8;
    color: #0a6c74;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.header-actions {
    margin-top: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f4ff;
    color: #667eea;
}

.btn-secondary:hover {
    background: #e0e8ff;
}

.profile-section {
    border-bottom: 1px solid #e8ecf4;
}

.profile-section:last-of-type {
    border-bottom: none;
}

.section-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 40px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.section-header:hover {
    background: #f8f9ff;
}

.section-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.section-header h2 {
    flex: 1;
    font-size: 1.1rem;
    color: #1a1a2e;
    font-weight: 600;
}

.chevron {
    transition: transform 0.3s;
    color: #667eea;
}

.profile-section.collapsed .chevron {
    transform: rotate(-90deg);
}

.section-content {
    padding: 0 40px 30px 88px;
    transition: all 0.3s ease;
}

.profile-section.collapsed .section-content {
    display: none;
}

.section-content p {
    color: #555;
    white-space: pre-line;
}

.capabilities-list {
    list-style: none;
    display: grid;
    gap: 12px;
}

.capabilities-list li {
    position: relative;
    padding-left: 28px;
    color: #555;
}

.capabilities-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
}

.how-it-works-grid {
    display: grid;
    gap: 20px;
}

.how-step {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.how-step h4 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.how-step p {
    color: #555;
}

.profile-footer {
    background: #f8f9ff;
    padding: 30px 40px;
    border-top: 1px solid #e8ecf4;
}

.metadata {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    color: #888;
    font-size: 0.9rem;
}

.disclaimer {
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #f0ad4e;
}

.empty-profile h2, .error-state h2 {
    color: #1a1a2e;
    margin-bottom: 12px;
}

.empty-profile p, .error-state p {
    color: #666;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .profile-container {
        padding: 16px;
    }
    
    .profile-header {
        padding: 24px;
    }
    
    .profile-header h1 {
        font-size: 1.5rem;
    }
    
    .section-header {
        padding: 16px 20px;
    }
    
    .section-content {
        padding: 0 20px 24px 56px;
    }
    
    .profile-footer {
        padding: 24px 20px;
    }
    
    .metadata {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 600px) {
    .profile-container {
        padding: 10px;
    }
    
    .profile-header {
        padding: 16px;
    }
    
    .profile-header h1 {
        font-size: 1.25rem;
    }
    
    .header-badges {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .section-header {
        padding: 12px 16px;
    }
    
    .section-header h2 {
        font-size: 1rem;
    }
    
    .section-content {
        padding: 0 16px 20px 40px;
    }
    
    .section-number {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    .profile-nav {
        padding: 12px;
    }
    
    .back-link {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* New enhanced profile sections */
.transparency-grid {
    display: grid;
    gap: 12px;
}

.transparency-item {
    padding: 12px 16px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.transparency-item strong {
    color: #4a5568;
    margin-right: 8px;
}

.impact-list {
    list-style: none;
    padding: 0;
}

.impact-list li {
    padding: 10px 16px;
    background: #f0fff4;
    border-left: 3px solid #48bb78;
    border-radius: 0 8px 8px 0;
    margin-bottom: 8px;
}

.who-its-for-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.who-block {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 12px;
}

.who-block h4 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1rem;
}

.who-block ul {
    list-style: none;
    padding: 0;
}

.who-block li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.who-block li:last-child {
    border-bottom: none;
}

.how-to-use-grid {
    display: grid;
    gap: 24px;
}

.use-block h4 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1rem;
}

.inputs-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.inputs-table th,
.inputs-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.inputs-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

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

.inputs-table tr:nth-child(even) {
    background: #f8f9ff;
}

.use-block ul {
    list-style: none;
    padding: 0;
}

.use-block li {
    padding: 10px 16px;
    background: #fff;
    border-left: 3px solid #667eea;
    margin-bottom: 8px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.prompt-suggestions-list {
    list-style: none;
    padding: 0;
}

.prompt-suggestion {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border: 1px solid #e2e8f0;
    border-left: 4px solid #667eea;
    border-radius: 0 12px 12px 0;
    margin-bottom: 12px;
    font-style: italic;
    color: #4a5568;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.prompt-suggestion:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

@media (max-width: 600px) {
    .who-its-for-grid {
        grid-template-columns: 1fr;
    }
    
    .inputs-table th,
    .inputs-table td {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

@media print {
    body {
        background: white;
    }
    
    .profile-nav, .header-actions {
        display: none;
    }
    
    .profile-section.collapsed .section-content {
        display: block;
    }
    
    .profile-container {
        max-width: 100%;
    }
}
