/* World Chat Styles - Modern & Full-screen */
.main-content {
    padding: 0 !important;
    overflow: hidden;
    background: var(--surface-color);
}

.world-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--surface-color);
    position: relative;
}

/* Modern Header Styles */
.world-header {
    padding: 1.25rem 2rem;
    background: var(--surface-color);
    color: #e4e4e4;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 20px rgba(53, 53, 53, 0.15);
    backdrop-filter: blur(10px);
}

.world-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.world-header-content h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
}

.world-header-content h1 i {
    font-size: 1.5rem;
    background: #ffffff;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.online-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    color: #000000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.online-status:hover {
    background: var(--hover-color);
    transform: translateY(-1px);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.world-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    color: white;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.action-btn i {
    font-size: 1rem;
}

/* Content Area */
.world-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    position: relative;
    overflow: hidden;
}

.world-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--surface-color);
    scroll-behavior: smooth;
}

.world-messages::-webkit-scrollbar {
    width: 6px;
}

.world-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.world-messages::-webkit-scrollbar-track {
    background: transparent;
}

.world-message {
    max-width: 75%;
    margin: 0.5rem 0;
    animation: fadeIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    position: relative;
}

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

.world-message.incoming {
    align-self: flex-start;
}

.world-message.outgoing {
    align-self: flex-end;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem;
    margin-bottom: 0.25rem;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.message-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.message-bubble {
    padding: 1rem 1.25rem;
    border-radius: 1.25rem;
    position: relative;
    line-height: 1.5;
    font-size: 0.95rem;
    max-width: 100%;
    word-wrap: break-word;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-time {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.incoming .message-bubble {
    background: var(--surface-alt-color);
    color: var(--text-color);
    border-bottom-left-radius: 0.25rem;
}

.outgoing .message-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

/* Modern Input Section */
.world-input {
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.input-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 0.75rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.input-container:focus-within {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(var(--primary-color-rgb), 0.15);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.world-input .btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    background: transparent;
}

.world-input .btn:hover {
    background: var(--hover-color);
    color: var(--primary-color);
}

.textarea-wrapper {
    flex: 1;
    min-width: 0;
    margin: 0 0.25rem;
    position: relative;
}

textarea {
    width: 100%;
    min-height: 24px;
    max-height: 72px;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
}

textarea:focus {
    outline: none;
}

textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.send-btn {
    color: var(--primary-color);
    background: var(--hover-color);
}

.send-btn:hover {
    background: var(--primary-color);
    color: white;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.typing-text {
    font-style: italic;
}

.char-counter {
    font-variant-numeric: tabular-nums;
}

.input-container:focus-within {
    background: var(--input-bg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.input-buttons {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
}

.input-buttons {
    display: flex;
    gap: 0.5rem;
}

.input-buttons .btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.2s ease;
    background: transparent;
    position: relative;
}

.input-buttons .btn:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.input-buttons .btn:active {
    transform: translateY(0);
}

.input-buttons .btn::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 0.8rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.4rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.input-buttons .btn:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

.textarea-wrapper {
    flex: 1;
    min-width: 0;
    margin: 0 0.75rem;
    position: relative;
}

textarea {
    width: 100%;
    min-height: 24px;
    max-height: 120px;
    padding: 0.75rem;
    border: none;
    background: none;
    resize: none;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
    transition: all 0.3s ease;
}

textarea:focus {
    outline: none;
}

textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

textarea:focus::placeholder {
    opacity: 0.4;
}

textarea:focus {
    outline: none;
}

textarea::placeholder {
    color: var(--text-muted);
}

.send-btn {
    background: var(--primary-color) !important;
    color: white !important;
    width: 42px !important;
    height: 42px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.send-btn:hover {
    transform: scale(1.05) !important;
}

/* System Message Styles */
.system-message {
    align-self: center;
    max-width: 80%;
    text-align: center;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background: var(--surface-alt-color);
    border-radius: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Profile Popup Styles */
.profile-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.2s ease;
}

.profile-popup.active {
    display: flex;
    opacity: 1;
}

.profile-popup-content {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.profile-popup.loading .profile-popup-content {
    position: relative;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-popup.loading .profile-popup-content::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

.profile-popup-content {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.profile-header,
.profile-info,
.profile-actions {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.profile-popup.loading .profile-header,
.profile-popup.loading .profile-info,
.profile-popup.loading .profile-actions {
    opacity: 0;
    visibility: hidden;
}

.profile-popup.active .profile-popup-content {
    transform: translateY(0);
}

.close-popup {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-popup:hover {
    background: var(--hover-color);
    color: var(--text-color);
}

.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    padding: 3px;
    margin-bottom: 1rem;
}

.profile-name {
    font-size: 1.5rem;
    margin: 0.5rem 0;
    color: var(--text-color);
}

.profile-status {
    display: inline-block;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    background: var(--primary-color);
    color: white;
    font-size: 0.875rem;
}

.profile-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
    opacity: 1;
    visibility: visible;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background: var(--surface-alt-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    min-height: 100px;
    position: relative;
    overflow: hidden;
}

.info-item i {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.info-item .stats-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.info-item .activity-score,
.info-item .user-rank,
.info-item .join-date,
.info-item .message-count {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.info-item:hover {
    transform: translateY(-2px);
}

.info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stats-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.profile-actions {
    display: flex;
    gap: 1rem;
}

.profile-actions button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-full-profile {
    background: var(--surface-alt-color);
    color: var(--text-color);
}

.start-chat {
    background: var(--primary-color);
    color: white;
}

.view-full-profile:hover {
    background: var(--hover-color);
}

.start-chat:hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
}

/* Make message author and avatar clickable */
.message-author,
.message-avatar {
    cursor: pointer;
    transition: all 0.2s ease;
}

.message-author:hover {
    color: var(--primary-color);
}

.message-avatar:hover {
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .world-container {
        margin: 0;
        height: 100vh;
        border-radius: 0;
    }

    .world-header {
        padding: 1rem;
    }

    .world-header h1 {
        font-size: 1.25rem;
    }

    .world-message {
        max-width: 85%;
    }

    .profile-popup-content {
        width: 95%;
        padding: 1.5rem;
    }

    .profile-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
