/* General Body & Font Styling */
body {
    background-color: #EEF2FF; /* 4chan's light blue background */
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    margin: 0;
    padding: 20px 15px;
}

a {
    color: #34345C;
    text-decoration: underline;
}

a:hover {
    color: #DD0000;
}

hr {
    border: none;
    border-top: 1px solid #B7C5D9;
    margin: 30px 0;
}

/* Logo and Title Styling */
header {
    text-align: center;
    margin-bottom: 20px;
}

.top-logo {
    display: block;
    margin: 10px auto 15px auto;
    width: 20%;
    max-width: 250px;
    min-width: 100px;
}

.board-title {
    font-size: 24px;
    color: #AF0A0F;
    font-weight: bold;
    margin: 0;
}

/* Main Content Container */
main {
    max-width: 900px;
    margin: 0 auto;
}

/* Thread Container */
.thread {
    margin-bottom: 25px;
}
.loading {
    color: #666;
    font-style: italic;
}

.error {
    color: #ff4444;
    font-weight: bold;
}

.map-unavailable {
    text-align: center;
    padding: 20px;
    color: #666;
    background: #f5f5f5;
    border-radius: 4px;
}
/* General Post Styling */
.post {
    margin-bottom: 5px;
    display: table;
    border-spacing: 0;
    width: 100%;
}

.post.op {
    /* The OP doesn't have a background box */
}

.post.reply {
    background-color: #D6DAF0;
    border: 1px solid #B7C5D9;
    border-radius: 2px;
    padding: 10px;
    margin-left: 20px;
    max-width: calc(100% - 30px);
}

/* Post Header Styling */
.post-header {
    font-size: 12px;
    color: #117743;
    margin-bottom: 8px;
}

.post-header .subject {
    color: #0F0C5D;
    font-weight: bold;
    margin-right: 10px;
}

.post-header .name {
    font-weight: bold;
}

.post-header .timestamp {
    color: #4F4F4F;
    margin: 0 10px;
}

.post-header .post-number a {
    text-decoration: none;
}
.post-header .post-number a:hover {
    text-decoration: underline;
}

/* Post Body Styling */
.post-body {
    line-height: 1.5;
    word-wrap: break-word; /* Important for mobile */
}

.ip-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.post-body .ip-address {
    font-size: 3em;
    font-weight: bold;
    color: #AF0A0F;
    text-align: center;
    margin: 10px 0;
}

.refresh-button {
    font-size: 14px;
    color: #34345C;
    text-decoration: underline;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.refresh-button:hover {
    color: #DD0000;
}

.refresh-button.loading {
    color: #999;
    text-decoration: none;
    cursor: default;
    pointer-events: none;
}


.greentext, .post-body span {
    color: #789922;
}

/* FAQ Section Styles */
.faq-thread {
    margin-top: 20px;
}

.faq-title {
    font-size: 18px;
    color: #0F0C5D;
    text-align: left;
    margin-bottom: 10px;
    padding-left: 5px;
}

.faq-thread .post.reply {
    margin-left: 0;
    max-width: 100%;
}

.question {
    font-weight: bold;
    color: #789922;
    margin: 0 0 5px 0;
}

/* Map Styling */
#map {
    height: 250px;
    border: 1px solid #B7C5D9;
    margin-top: 10px;
}

/* --- IMPROVED IP Lookup Form Styling with Flexbox --- */
.ip-lookup-form {
    margin-left: 0 !important;
    max-width: 100% !important;
}

.ip-lookup-form form {
    padding: 10px;
    display: flex; /* This is the magic! */
    align-items: center; /* Vertically aligns items */
    gap: 10px; /* Creates space between items */
}

.ip-lookup-form .form-header {
    font-weight: bold;
    margin-bottom: 8px;
    color: #0F0C5D;
    /* Hide the header on the form itself, it's redundant */
    display: none;
}

.ip-lookup-form input[type="text"] {
    flex-grow: 1; /* Makes the input take all available space */
    padding: 8px;
    border: 1px solid #B7C5D9;
    background-color: #FFF;
    font-family: Arial, sans-serif;
    /* Remove fixed width and margin */
}

.ip-lookup-form button {
    padding: 8px 15px;
    background-color: #D6DAF0;
    border: 1px solid #B7C5D9;
    cursor: pointer;
    font-weight: bold;
    flex-shrink: 0; /* Prevents the button from shrinking */
}

.ip-lookup-form button:hover {
    background-color: #c5c9e2;
}


/* --- Mobile Friendliness (Media Query) --- */
@media (max-width: 768px) {
    body {
        padding: 15px 10px;
        font-size: 13px;
    }

    .board-title {
        font-size: 20px;
    }
    
    .post-body .ip-address {
        font-size: 2.2em;
        margin: 5px 0;
    }

    .post.reply {
        margin-left: 0;
        max-width: 100%;
    }

    .faq-title {
        font-size: 16px;
    }
    
    /* IMPROVED: Media query for the form */
    .ip-lookup-form form {
        flex-direction: column; /* Stacks the items vertically */
    }
    
    .ip-lookup-form input[type="text"],
    .ip-lookup-form button {
        width: 100%; /* Make both items full width */
        box-sizing: border-box; /* Ensures padding is included in width */
    }
}