/* Modal overlay and base styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Slide-up modal styles */
.redeem-modal,
.users-modal {
    background: #2a2a2a;
    border: 1px solid #454545;
    border-radius: 20px 20px 0 0;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    position: relative;
    backdrop-filter: blur(15px);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.users-modal {
    max-width: 600px;
    max-height: 70vh;
    overflow: hidden;
}

.modal-overlay.active .redeem-modal,
.modal-overlay.active .users-modal {
    transform: translateY(0);
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: #454545;
    border-radius: 2px;
    margin: 0 auto 1.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-handle:hover {
    background: #909090;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-title svg {
    color: #ff6161;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #909090;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.modal-description {
    color: #909090;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Key input field */
.key-input {
    width: 100%;
    background: rgba(31, 31, 31, 0.8);
    border: 2px solid #454545;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Inter', 'SF Mono', Monaco, monospace;
}

.key-input:focus {
    outline: none;
    border-color: #ff6161;
    box-shadow: 0 0 0 4px rgba(255, 97, 97, 0.1);
    background: rgba(31, 31, 31, 0.95);
}

.key-input::placeholder {
    color: #454545;
}

.redeem-btn {
    background: linear-gradient(135deg, #ff6161, #cc1100);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.redeem-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 97, 97, 0.4);
}

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

.redeem-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Online users modal */
.users-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 1rem;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(31, 31, 31, 0.5);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid #454545;
    transition: all 0.2s ease;
}

.user-item:hover {
    background: rgba(31, 31, 31, 0.8);
    border-color: #ff6161;
    transform: translateX(4px);
}

.user-item.current-user {
    border-color: #ff6161;
    background: rgba(255, 97, 97, 0.1);
}

.user-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6161, #cc1100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 1rem;
    color: white;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.user-details {
    font-size: 0.8rem;
    color: #909090;
    display: flex;
    gap: 1rem;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: pulse 2s infinite;
}

.loading-users {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: #909090;
}
