/**
 * RSI Profile Viewer - SCHQ Integration
 * Sprint 3: Frontend Profile Viewer
 */

/* ============================================
   PROFILE SEARCH
   ============================================ */

.rsi-profile-search {
    margin-bottom: 20px;
}

.rsi-search-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.rsi-search-input {
    flex: 1;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 14px;
}

.rsi-search-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

.rsi-search-btn {
    padding: 10px 20px;
    background: var(--accent-primary);
    border: none;
    border-radius: 5px;
    color: var(--bg-primary);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rsi-search-btn:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

.rsi-search-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.5;
}

/* ============================================
   PROFILE DISPLAY
   ============================================ */

.rsi-profile-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.rsi-profile-container.visible {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Profile Header */
.rsi-profile-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 191, 255, 0.1));
    border-radius: 8px;
    border: 1px solid var(--accent-primary);
}

.rsi-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px solid var(--accent-primary);
    object-fit: cover;
}

.rsi-profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rsi-profile-handle {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent-primary);
    margin: 0;
}

.rsi-profile-uee {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.rsi-profile-enlisted {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0;
}

.rsi-profile-location {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.rsi-profile-location .flag {
    margin-right: 5px;
}

/* Main Organization */
.rsi-main-org {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 255, 136, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.rsi-main-org h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--accent-primary);
    text-transform: uppercase;
}

.rsi-org-card {
    display: flex;
    gap: 12px;
    align-items: center;
}

.rsi-org-logo {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    border: 1px solid var(--accent-primary);
    object-fit: cover;
}

.rsi-org-info {
    flex: 1;
}

.rsi-org-name {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0 0 5px 0;
}

.rsi-org-sid {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: monospace;
}

.rsi-org-rank {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 5px 0;
}

.rsi-rank-stars {
    color: #ffd700;
    font-size: 12px;
}

.rsi-rank-name {
    font-size: 11px;
    color: var(--text-secondary);
}

.rsi-org-members {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Affiliations */
.rsi-affiliations {
    margin-bottom: 20px;
}

.rsi-affiliations h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.rsi-affiliation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.rsi-affiliation-item {
    display: flex;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

.rsi-affiliation-logo {
    width: 30px;
    height: 30px;
    border-radius: 3px;
    object-fit: cover;
}

.rsi-affiliation-info {
    flex: 1;
}

.rsi-affiliation-name {
    font-size: 12px;
    color: var(--text-primary);
    margin: 0;
}

.rsi-affiliation-rank {
    font-size: 10px;
    color: var(--text-secondary);
    margin: 0;
}

/* Relations Buttons */
.rsi-relations {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.rsi-relations h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.rsi-relation-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.rsi-relation-btn {
    padding: 10px;
    border: 2px solid;
    border-radius: 5px;
    background: transparent;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.rsi-relation-btn.friendly {
    border-color: #00ff88;
    color: #00ff88;
}

.rsi-relation-btn.friendly:hover,
.rsi-relation-btn.friendly.active {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
}

.rsi-relation-btn.neutral {
    border-color: #888888;
    color: #888888;
}

.rsi-relation-btn.neutral:hover,
.rsi-relation-btn.neutral.active {
    background: rgba(136, 136, 136, 0.2);
    border-color: #888888;
}

.rsi-relation-btn.unknown {
    border-color: #ff9500;
    color: #ff9500;
}

.rsi-relation-btn.unknown:hover,
.rsi-relation-btn.unknown.active {
    background: rgba(255, 149, 0, 0.2);
    border-color: #ff9500;
}

.rsi-relation-btn.hostile {
    border-color: #ff4444;
    color: #ff4444;
}

.rsi-relation-btn.hostile:hover,
.rsi-relation-btn.hostile.active {
    background: rgba(255, 68, 68, 0.2);
    border-color: #ff4444;
}

.rsi-relation-btn.active {
    font-weight: bold;
    transform: scale(1.05);
}

/* Comment Box */
.rsi-comment-box {
    margin-top: 15px;
}

.rsi-comment-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: block;
}

.rsi-comment-input {
    width: 100%;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 12px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.rsi-comment-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Loading State */
.rsi-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.rsi-loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 255, 136, 0.3);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error State */
.rsi-error {
    padding: 15px;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    border-radius: 5px;
    color: #ff4444;
    margin-bottom: 15px;
}

/* Cache Indicator */
.rsi-cache-info {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 10px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Empty State */
.rsi-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.rsi-empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.rsi-empty-state-text {
    font-size: 14px;
}

/* Responsive */
@media (max-width: 767px) {
    .rsi-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .rsi-relation-buttons {
        grid-template-columns: 1fr;
    }
}
