/* --- Global Styles --- */
body {
    background-color: #fef6e1;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.wrapper {
    width: 90%;
    text-align: center;
    padding: 5px 20px 20px 20px;
}

/* --- Header --- */
header img {
  max-width: 250px; /* slightly smaller for desktop */
  height: auto;
}

/* --- Navigation --- */
nav {
    margin-top: 10px;
}

nav a {
    display: inline-block;
    margin: 0 15px;
    text-decoration: none;
    font-weight: 500;
    color: #9d000e;
    font-size: 18px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #004c59;
}

/* --- Main content --- */
main {
    background: white;
	width: 98%;
    margin-top: 25px;
	padding: 40px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: left;
}

main h1 {
    color: #9d000e;
    font-size: 22px;
	padding: 0 40px;
}

main h2 {
    color: #9d000e;
    font-size: 20px;
	padding: 0 40px;
}

main h3 {
    color: #000;
    font-size: 18px;
    padding: 0 40px;
}

main p {
    color: #333;
    line-height: 1.6;
	padding: 0 40px;
}

.bot-info {
    color: #333;
    line-height: 1.6;
    padding: 0 40px;
}

/* --- Table Styles --- */
.table-container {
    display: flex;
    flex-direction: column;
    border: 2px solid #000;
    width: 95%;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 4px 4px 0 #888;
}

.row {
    display: flex;
    border-bottom: 1px solid #000;
    padding: 4px 8px;
}

.row.header {
    font-weight: bold;
    background-color: #008080;
    color: #fff;
    border-bottom: 2px solid #000;
}

/* Adjust column widths */
.cell {
    padding: 4px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-right: 1px solid #000;
}

.cell:last-child {
    border-right: none;
}

.cell.bot-name { flex: 1; }        /* Bot/Crawler Name: small-medium */
.cell.ip { flex: 1; }              /* IP Address: small */
.cell.hostname { flex: 2; }        /* Hostname: medium */
.cell.user-agent { flex: 3; }      /* User Agent: slightly bigger */

.row:nth-child(even):not(.header) {
    background-color: #e0e0e0;
}

.row:nth-child(odd):not(.header) {
    background-color: #f0f0f0;
}

/* --- Pagination --- */
.pagination {
    margin: 20px auto;
    text-align: center;
}

.pagination a {
    margin: 0 5px;
    padding: 5px 10px;
    background: #008080;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
}

.pagination a.active {
    background: #000;
}

/* Expand-on-click behavior */
.cell.expandable {
    cursor: pointer;
    transition: all 0.2s ease;
}
.cell.expandable.open {
    white-space: normal;
    overflow: visible;
    background-color: #fff6b3;
}

.row.header a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
}

.row.header a:hover {
    text-decoration: underline;
}

/* --- Bot Counter Styling --- */
.bot-count-wrapper {
    text-align: center; /* centers the inline-block element inside */
    margin-bottom: 15px;
}

.bot-count {
    display: inline-block;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    font-weight: bold;
    color: #008080; /* match main accent color */
    background-color: #f0f0f0; /* soft light background to match table rows */
    padding: 12px 25px;
    border: 2px solid #008080; /* teal border to match theme */
    border-radius: 6px;
    box-shadow: 2px 2px 0 #888; /* subtle shadow to mimic table style */
}

.bot-count-number {
    font-size: 18px;
    text-decoration: underline;
}

/* --- Form Styling --- */
.bot-search-form {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.bot-search-form .form-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Style the selects, input, and button */
.bot-search-form select,
.bot-search-form input[type="text"],
.bot-search-form button {
    padding: 8px 10px;
    font-size: 16px;
    min-width: 150px;
    width: 200px; /* uniform width for desktop */
    box-sizing: border-box;
}

.bot-search-form button {
    background-color: #008080;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.bot-search-form .clear-link {
    margin-left: 10px;
    color: #9d000e;
    text-decoration: underline;
}

/* Main area images */
.responsive-image {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 350px;
    height: auto;
  }

  /* When the screen width is 768px or less (typical mobile) */
  @media (max-width: 768px) {
    .responsive-image {
      width: 70%;
    }
  }

/* --- Mobile adjustments --- */
@media (max-width: 768px) {
    .bot-search-form {
        flex-direction: column;
        align-items: center;
    }
    .bot-search-form .form-row {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }
    .bot-search-form select,
    .bot-search-form input[type="text"],
    .bot-search-form button {
        width: 90%;
        max-width: 300px;
    }
}

/* --- Responsive Table (Mobile) --- */
@media (max-width: 768px) {
    /* Hide IP and User-Agent columns */
    .cell.ip,
    .cell.user-agent {
        display: none;
    }

    /* Adjust remaining columns to fill space */
    .cell.bot-name { flex: 1.5; }
    .cell.hostname { flex: 2; }

    /* Adjust header visibility too */
    .row.header .cell.ip,
    .row.header .cell.user-agent {
        display: none;
    }
}

/* --- Mobile Adjustments for Bot Counter --- */
@media (max-width: 768px) {
    .bot-count {
        padding-left: 15px;
        padding-right: 15px;
        max-width: 95%; /* prevent stretching edge-to-edge */
        box-sizing: border-box; /* ensures padding doesn’t overflow */
    }
}

@media (max-width: 768px) {
    /* Remove the right border (|) on hostname for mobile */
    .cell.hostname {
        border-right: none;
    }
}

/* --- Mobile adjustment --- */
@media (max-width: 768px) {
  header img {
    max-width: 180px; /* smaller logo on tablets/phones */
  }
}

@media (max-width: 480px) {
  header img {
    max-width: 150px; /* even smaller for small phones */
  }
}

@media (max-width: 768px) {
    main p {
        padding: 40px 20px; /* ↑ top & bottom bigger, sides smaller for mobile */
    }
}

/* remove padding */
@media (max-width: 768px) {
    main h2,
    main h3 {
        padding: 0 20px;
    }
}