/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
}

.modal-content {
    background-color: #36393f;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    border: 1px solid #3c3c41;
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.close-modal {
    background: none;
    border: none;
    color: #8e9297;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.close-modal:hover {
    background-color: #42464d;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.modal-buttons.single-button-row {
    justify-content: center;
}

.modal-button {
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.15s ease;
}

.modal-button.primary {
    background-color: #7289da;
    color: white;
}

.modal-button.primary:hover {
    background-color: #677bc4;
}

.modal-button.secondary {
    background-color: #4f545c;
    color: #dcddde;
}

.modal-button.secondary:hover {
    background-color: #5d6269;
}

.premium-modal {
    max-width: 500px;
}

.premium-benefits {
    margin: 20px 0;
}

.premium-benefits h4 {
    color: #ffffff;
    margin-bottom: 12px;
}

.premium-benefits ul {
    list-style: none;
    padding: 0;
}

.premium-benefits li {
    padding: 8px 0;
    color: #dcddde;
    font-size: 14px;
}

.premium-buy {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    font-weight: bold;
}

.premium-section {
    border: 1px solid #4f545c;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.premium-section h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #ffffff;
}

.premium-section p {
    font-size: 14px;
    color: #dcddde;
    margin-bottom: 16px;
}

.fullscreen-modal .modal-content {
    width: 90vw;
    height: 90vh;
    max-width: none;
    margin: 5vh auto;
}

/* AI Chatbot Modal */
.ai-chatbot-content {
    display: flex;
    flex-direction: column;
}

.ai-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 70vh;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: #40444b;
    border-radius: 8px;
    margin-bottom: 16px;
}

.ai-messages > div { 
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 8px;
}
.ai-messages > div:not(:last-child) {
    margin-bottom: 12px;
}

/* Specific AI/User message styles */
.ai-messages .user-message {
    background-color: #5865f2;
    color: white;
    margin-left: 20%;
    text-align: right;
}

.ai-messages .ai-message {
    background-color: #3c3c41;
    color: #dcddde;
    margin-right: 20%;
}

.ai-messages img {
    max-width: 200px;
    border-radius: 8px;
}

.ai-messages audio {
    width: 100%;
}


.ai-input-container {
    display: flex;
    gap: 8px;
}

.ai-input-container input {
    flex: 1;
}

/* Emoji Picker Modal */
.emoji-picker-content {
    width: 400px;
    height: 500px;
}

.emoji-tabs {
    display: flex;
    border-bottom: 1px solid #3c3c41;
    margin-bottom: 16px;
}

.emoji-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: #8e9297;
    cursor: pointer;
    transition: color 0.15s ease;
}

.emoji-tab.active,
.emoji-tab:hover {
    color: #ffffff;
    background-color: #42464d;
}

.emoji-content {
    height: 350px;
    overflow-y: auto;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    padding: 8px;
}

.emoji-item {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
    font-size: 32px;
}

.emoji-item:hover {
    background-color: #42464d;
}

.gif-item {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
}

.gif-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tournament Modal */
.tournament-list {
    max-height: 200px; /* Adjusted height to make space for creation form */
    overflow-y: auto;
    margin: 16px 0;
}

.tournament-item {
    background-color: #42464d;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.tournament-item:hover {
    background-color: #4f545c;
}

.tournament-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
}

.status-upcoming {
    background-color: #ffa500;
    color: #000;
}

.status-active {
    background-color: #43b581;
    color: #000;
}

.status-ended {
    background-color: #747f8d;
    color: #fff;
}

/* Server creation limit info */
.server-limit-info {
    font-size: 14px;
    color: #8e9297;
    margin-bottom: 16px;
    text-align: center;
}