/* === ENHANCED USERS PAGE STYLES === */

.page-header {
    padding: 40px;
    text-align: center;
    border-bottom: 1px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(16, 21, 32, 0.95) 0%, rgba(26, 34, 50, 0.95) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.page-header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 32px;
    color: var(--primary-color);
    margin: 0;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.back-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 16px;
    border: 1px solid var(--primary-color);
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(0, 240, 255, 0.1);
}

.back-link:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.3);
}

#users-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 60vh;
}

/* Loading State */
.users-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    flex-direction: column;
    gap: 20px;
}

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--primary-color);
    font-family: 'Orbitron', monospace;
    font-size: 18px;
}

/* Empty State */
.users-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.users-empty h3 {
    font-family: 'Orbitron', monospace;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.users-empty p {
    opacity: 0.7;
}

.user-card {
    background: linear-gradient(135deg, rgba(16, 21, 32, 0.9) 0%, rgba(26, 34, 50, 0.9) 100%);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 240, 255, 0.2);
    border-color: var(--primary-color);
}

.user-card-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(16, 21, 32, 0.95) 0%, rgba(26, 34, 50, 0.95) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.user-card:hover .user-card-hover {
    opacity: 1;
}

.user-card-hover .chat-btn,
.user-card-hover .view-profile-btn {
    background: linear-gradient(135deg, var(--primary-color), #00d4ff);
    color: var(--secondary-color);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    text-decoration: none;
    display: inline-block;
    width: 80%;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-card-hover .chat-btn:hover,
.user-card-hover .view-profile-btn:hover {
    background: linear-gradient(135deg, transparent, transparent);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
}

.user-card-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    transition: all 0.3s ease;
}

.user-card:hover .user-card-pic {
    border-color: #00d4ff;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
}

.user-card-name {
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    color: var(--primary-color);
    margin: 0;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* === MODERN ERROR MODAL === */
.error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.error-modal.show {
    opacity: 1;
    visibility: visible;
}

.error-modal-content {
    background: linear-gradient(135deg, rgba(16, 21, 32, 0.98) 0%, rgba(26, 34, 50, 0.98) 100%);
    border: 2px solid #ff4757;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(255, 71, 87, 0.3);
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.error-modal.show .error-modal-content {
    transform: scale(1);
}

.error-icon {
    font-size: 60px;
    color: #ff4757;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.error-title {
    font-family: 'Orbitron', monospace;
    color: #ff4757;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 600;
}

.error-message {
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.error-btn.primary {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    color: white;
}

.error-btn.secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.error-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.3);
}

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

/* === ENHANCED CHAT MODAL === */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    background: linear-gradient(135deg, rgba(16, 21, 32, 0.98) 0%, rgba(26, 34, 50, 0.98) 100%);
    margin: auto;
    padding: 0;
    border: 2px solid var(--primary-color);
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 240, 255, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 240, 255, 0.3);
    padding: 20px 25px;
    background: rgba(0, 240, 255, 0.05);
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    color: var(--primary-color);
    font-family: 'Orbitron', monospace;
    font-size: 22px;
    margin: 0;
    font-weight: 600;
}

.close-button {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.1);
}

.close-button:hover {
    background: rgba(0, 240, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 25px;
    max-height: 300px;
    min-height: 200px;
}

.message {
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 75%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.sent {
    background: linear-gradient(135deg, var(--primary-color), #00d4ff);
    color: var(--secondary-color);
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

.message.received {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: var(--text-light);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer {
    display: flex;
    border-top: 1px solid rgba(0, 240, 255, 0.3);
    padding: 20px 25px;
    background: rgba(0, 240, 255, 0.05);
    border-radius: 0 0 16px 16px;
    gap: 15px;
    flex-shrink: 0;
}

#chat-message-input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

#chat-message-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

#chat-message-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#chat-send-btn {
    background: linear-gradient(135deg, var(--primary-color), #00d4ff);
    color: var(--secondary-color);
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    min-width: 80px;
}

#chat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.3);
}

#chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
    .page-header {
        padding: 30px 20px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    #users-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
        padding: 20px;
    }

    .user-card {
        padding: 20px;
    }

    .user-card-pic {
        width: 100px;
        height: 100px;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header,
    .modal-footer {
        padding: 15px 20px;
    }

    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    #users-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .error-modal-content {
        padding: 20px;
    }

    .error-actions {
        flex-direction: column;
    }
}