/* css/detailSocial.css */

/* Game Detail Resources */
.game_detail_resources_logged_out {
    padding: 20px;
    text-align: center;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 10px;
    height: 100%;
}

body.dark-mode .game_detail_resources_logged_out {
    background-color: #2a2a2a;
    border: 1px solid #00cc00;
}

.game_detail_resources {
    height: 25%;
    display: flex;
    flex-direction: row;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

body.dark-mode .game_detail_resources {
    border: 1px solid #00cc00;
}

/* Increase specificity to avoid global span styles */
.game_detail_resources .chat_message .chat_username,
.game_detail_resources .chat_message .chat_message_text,
.game_detail_resources .chat_message .chat_topic_icon,
.game_detail_resources .chat_message .chat_timestamp,
.game_detail_resources .chat_message .chat_votes {
    margin: 0;
    text-align: left;
    font-size: inherit;
}

.resource_topics {
    width: 20%;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    border-right: 1px solid #ccc;
    overflow: hidden;
}

body.dark-mode .resource_topics {
    border-right: 1px solid #00cc00;
}

.resource_selectors {
    height: 75%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px 0;
}

.resource_selectors button {
    padding: 10px;
    margin: 5px 0;
    font-size: 2vmin;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    background-image: url(/media/vinylBackground.PNG);
    background-blend-mode: luminosity;
    color: #00cc00;
}

body.dark-mode .resource_selectors button {
    background-color: #333;
    color: #fff;
    border: 1px solid #00cc00;
}

.resource_selectors button:hover {
    background-color: #00cc00;
    color: #1a1a1a;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.resource_selectors button:active {
    background-color: #009900;
    color: #fff;
}

.resource_selectors button.active {
    background-color: #00cc00;
    color: #fff;
    border-bottom: 2px solid #fff;
}

/* Shared styles for resource_content and other content containers */
.resource_content,
.contact_content,
.server_content {
    flex: 1;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

body.dark-mode .resource_content {
    background: #1a1a1a;
}

.chat_output_container {
    flex: 1;
    max-height: calc(100% - 50px);
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    background-color: #f9f9f9;
    margin-bottom: 0;
    box-sizing: border-box;
}

body.dark-mode .chat_output_container {
    background-color: #2a2a2a;
    border: 1px solid #00cc00;
}

.chat_message {
    margin-bottom: 5px;
    word-wrap: break-word;
}

.chat_message .chat_username {
    font-weight: bold;
    color: #333;
}

body.dark-mode .chat_message .chat_username {
    color: #00cc00;
}

.chat_message .chat_message_text {
    margin-left: 5px;
    color: #000;
}

body.dark-mode .chat_message .chat_message_text {
    color: #fff;
}

.chat_message .chat_topic_icon {
    color: #666;
    margin: 0 5px;
}

.chat_message .chat_timestamp {
    color: #888;
    font-size: 0.8em;
    margin-left: 10px;
}

body.dark-mode .chat_message .chat_timestamp {
    color: #ccc;
}

.chat_message .chat_votes {
    color: #555;
    margin-left: 10px;
}

.chat_message button {
    margin-left: 5px;
    padding: 2px 5px;
    font-size: 0.8em;
}

#chat_output,
#contact_output {
    padding: 10px;
}

#chat_loading,
#contact_loading {
    text-align: center;
    color: #666;
    padding: 20px;
    display: none;
}

body.dark-mode #chat_loading {
    color: #ccc;
}

#chat_status,
#contact_status {
    text-align: center;
    color: #333;
    margin-top: 10px;
    font-style: italic;
}

body.dark-mode #chat_status {
    color: #fff;
}

.chat_topic_icon {
    color: #666;
    font-style: italic;
}

.chat_votes {
    font-weight: bold;
}

.vote_up,
.vote_down {
    padding: 2px 5px;
    font-size: 0.8em;
    cursor: pointer;
    margin-left: 5px;
}

.chat_input_container {
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    border-top: 1px solid #ccc;
    position: relative;
}

body.dark-mode .chat_input_container {
    border-top: 1px solid #00cc00;
}

#chat_input,
#contact_input {
    display: flex;
    align-items: center;
    width: 80%;
    box-sizing: border-box;
}

#chat_input #chat_topic_icon,
#contact_input #contact_topic_icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

#chat_input #chat_input_field,
#contact_input #contact_input_field {
    width: 100%;
    padding: 5px;
    font-size: 0.9em;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

body.dark-mode #chat_input_field {
    background: #333;
    color: #fff;
    border: 1px solid #00cc00;
}

#send_chat,
#submit_contact {
    padding: 5px 10px;
    font-size: 0.9em;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 5px;
    position: absolute;
    right: 10px;
    box-sizing: border-box;
}

body.dark-mode #send_chat {
    background: #333;
    color: #fff;
    border: 1px solid #00cc00;
}

/* Server Content Specific Styles */
.server_content {
    display: none;
    flex: 1;
    height: 100%;
    background-color: #f0f0f0;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
}

body.dark-mode .server_content {
    background-color: #2a2a2a;
}

.server_content_userlist {
    width: 40%;
    padding: 10px;
    border-right: 1px solid black;
    overflow: hidden;
}

body.dark-mode .server_content_userlist {
    border-right: 1px solid #00cc00;
}

.server_content_userlist #userlist_server_selection {
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
}

.server_content_userlist #server_content_userlistByServer {
    max-height: calc(100% - 40px);
    overflow-y: auto;
}

.server_content_characters {
    width: 40%;
    padding: 10px;
    border-right: 1px solid black;
}

body.dark-mode .server_content_characters {
    border-right: 1px solid #00cc00;
}

.server_content_interaction {
    width: 20%;
    padding: 10px;
}

.server_content_interaction #server_interaction_text {
    margin: 0;
}

.server_interaction_add_friend_button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    min-width: 100px;
}

body.dark-mode .server_interaction_add_friend_button {
    background-color: #333;
    color: #fff;
    border: 1px solid #00cc00;
}

.server_interaction_add_friend_button:hover {
    background-color: #00cc00;
    color: #1a1a1a;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.server_interaction_add_friend_button:active {
    background-color: #009900;
    color: #fff;
}

.server_interaction_add_friend_button img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

/* Responsive Design */
@media screen and (max-width: 720px) {
    .game_detail_resources {
        height: 40%;
        flex-direction: column;
        padding: 5px;
    }

    .resource_topics {
        width: 100%;
        flex-direction: row;
        gap: 5px;
        margin-bottom: 10px;
        overflow-x: auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #ccc;
    }

    body.dark-mode .resource_topics {
        border-bottom: 1px solid #00cc00;
    }

    .resource_selectors {
        flex-direction: row;
        height: auto;
        width: 75%;
    }

    .resource_selectors button {
        padding: 5px;
        margin: 0 2px;
        font-size: 0.8em;
    }

    .resource_content,
    .contact_content,
    .server_content {
        width: 100%;
        height: calc(100% - 40px);
    }

    .chat_output_container {
        max-height: calc(100% - 50px);
        overflow-y: auto;
        margin-bottom: 0;
    }

    .chat_input_container {
        height: 50px;
        padding: 0 5px;
    }

    #chat_input,
    #contact_input {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    #chat_input #chat_topic_icon,
    #contact_input #contact_topic_icon {
        margin-bottom: 5px;
        margin-right: 0;
    }

    #chat_input #chat_input_field,
    #contact_input #contact_input_field {
        width: 100%;
        margin-top: 5px;
    }

    #send_chat,
    #submit_contact {
        margin-left: 0;
        margin-top: 5px;
        width: 100%;
        position: static;
    }

    /* Adjust server_content for mobile */
    .server_content {
        flex-direction: column;
        height: calc(100% - 40px);
    }

    .server_content_userlist {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid black;
        padding: 5px;
    }

    body.dark-mode .server_content_userlist {
        border-bottom: 1px solid #00cc00;
    }

    .server_content_userlist #server_content_userlistByServer {
        max-height: 150px;
    }

    .server_content_characters {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid black;
        padding: 5px;
    }

    body.dark-mode .server_content_characters {
        border-bottom: 1px solid #00cc00;
    }

    .server_content_interaction {
        width: 100%;
        padding: 5px;
    }
}