/**
 * Game-Integrated Social Hub Styles
 * Card game specific enhancements for Aether Chronicles
 */

/* ===== CARD LINKING IN CHAT ===== */
.chat-card-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    display: inline-block;
    position: relative;
}

.chat-card-link:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.chat-deck-link {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    display: inline-block;
}

.chat-deck-link:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ===== DECK SHOWCASE ===== */
.deck-showcase {
    margin-bottom: 20px;
}

.featured-deck-display {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.featured-deck-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.featured-deck-placeholder {
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
}

.deck-preview-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.7;
}

.deck-preview-text {
    font-size: 1.1rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.deck-showcase-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.deck-showcase-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Featured deck when selected */
.featured-deck-active {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    text-align: left;
}

.featured-deck-icon {
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.featured-deck-info h4 {
    margin: 0 0 5px 0;
    color: white;
    font-size: 1.2rem;
}

.featured-deck-stats {
    display: flex;
    gap: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.featured-deck-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deck-action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.deck-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ===== GAME STATUS INDICATORS ===== */
.friend-status-with-game {
    display: flex;
    align-items: center;
    gap: 8px;
}

.friend-status-icon {
    font-size: 0.8rem;
    min-width: 16px;
}

.game-status-battle {
    color: #ff4444;
}

.game-status-deck {
    color: #4CAF50;
}

.game-status-trade {
    color: #ff9800;
}

.game-status-story {
    color: #9c27b0;
}

.game-status-online {
    color: #4CAF50;
}

/* ===== FRIEND CARD ENHANCEMENTS ===== */
.friend-card {
    position: relative;
    transition: all 0.3s ease;
}

.friend-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.friend-game-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.friend-card:hover .friend-game-actions {
    opacity: 1;
}

.friend-game-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.friend-game-action:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
}

.friend-game-action.challenge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
}

.friend-game-action.challenge:hover {
    background: linear-gradient(135deg, #ff8e8e 0%, #ff6b6b 100%);
}

.friend-game-action.spectate {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.friend-game-action.spectate:hover {
    background: linear-gradient(135deg, #44a08d 0%, #4ecdc4 100%);
}

.friend-game-action.trade {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.friend-game-action.trade:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

/* ===== COLLECTION STATS ===== */
.profile-stat-mini.collection {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.collection-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.collection-stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 6px;
}

.collection-stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.collection-stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

/* ===== GUILD CARD FEATURES ===== */
.guild-card-pool {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.guild-pool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.guild-pool-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.guild-pool-stats {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.guild-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}

.guild-card-preview {
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.guild-card-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ===== CHAT ENHANCEMENTS ===== */
.chat-game-invite {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.invite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.invite-type {
    font-weight: 600;
    font-size: 0.9rem;
}

.invite-time {
    font-size: 0.8rem;
    opacity: 0.8;
}

.invite-details {
    font-size: 0.9rem;
    margin-bottom: 12px;
    opacity: 0.9;
}

.invite-actions {
    display: flex;
    gap: 8px;
}

.invite-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.invite-btn.accept {
    background: #4CAF50;
    color: white;
}

.invite-btn.accept:hover {
    background: #45a049;
}

.invite-btn.decline {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.invite-btn.decline:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== SPECTATE MODE INDICATORS ===== */
.spectate-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 1000;
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: spectateGlow 2s ease-in-out infinite alternate;
}

@keyframes spectateGlow {
    from { box-shadow: 0 0 10px rgba(78, 205, 196, 0.5); }
    to { box-shadow: 0 0 20px rgba(78, 205, 196, 0.8); }
}

/* ===== PERFORMANCE INDICATORS ===== */
.social-performance-warning {
    background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    margin: 8px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== ADD FRIEND MODAL ===== */
.add-friend-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.add-friend-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-friend-modal .modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.add-friend-modal .modal-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.add-friend-modal .modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
}

.add-friend-modal .modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.add-friend-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.add-friend-modal .modal-body {
    padding: 20px;
}

.add-friend-modal .search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.add-friend-modal .friend-search-input {
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 6px;
    font-size: 1rem;
}

.add-friend-modal .friend-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.add-friend-modal .search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-friend-modal .search-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
}

.add-friend-modal .search-results {
    max-height: 300px;
    overflow-y: auto;
    color: white;
}

.add-friend-modal .user-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.add-friend-modal .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.add-friend-modal .user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.add-friend-modal .user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.add-friend-modal .user-name {
    font-weight: 600;
    color: white;
}

.add-friend-modal .user-stats {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.add-friend-modal .friend-request-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-friend-modal .friend-request-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
    transform: translateY(-1px);
}

.add-friend-modal .friend-status,
.add-friend-modal .request-status {
    color: #4CAF50;
    font-weight: 500;
    font-size: 0.8rem;
}

.add-friend-modal .loading,
.add-friend-modal .error-state {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.add-friend-modal .error-state {
    color: #ff6b6b;
}

.add-friend-modal .empty-state {
    text-align: center;
    padding: 40px 20px;
}

.add-friend-modal .empty-state-text {
    color: rgba(255, 255, 255, 0.6);
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
    .featured-deck-active {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 10px;
    }
    
    .featured-deck-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: center;
    }
    
    .friend-game-actions {
        opacity: 1; /* Always visible on mobile */
    }
    
    .guild-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .add-friend-modal .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .add-friend-modal .search-section {
        flex-direction: column;
    }
    
    .add-friend-modal .user-result {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* ===== ACCESSIBILITY ===== */
.chat-card-link:focus,
.chat-deck-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.deck-showcase-btn:focus,
.friend-game-action:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ===== ANIMATIONS ===== */
@keyframes cardLinkPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.chat-card-link.new {
    animation: cardLinkPulse 0.5s ease-in-out;
}

@keyframes deckShowcaseSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.featured-deck-active {
    animation: deckShowcaseSlide 0.3s ease-out;
}

/* ===== HOVER EFFECTS ===== */
.profile-section:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

.guild-card-pool:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transition: border-color 0.2s ease;
}