/* mysite/css/fairfight.css */

/* Main Peeper Tool Container - Overall Box */
.peeper-tool-container {
    max-width: 900px;
    margin-top: 50px; /* Adjusted to move it up for better visual balance */
    margin-left: auto;
    margin-right: auto;
    margin-bottom: auto; /* Keeps it vertically centered if content is short */
    background-color: #222;
    padding: 30px 40px;
    border-radius: 12px;
    border: 2px solid #00a8ff; /* Blue line around the container */
    box-shadow: 0 0 20px rgba(0, 122, 204, 0.4);
    text-align: center;
    width: 90%;
}

/* Page Title (e.g., "Fair Fight Scouter.") */
.script-title {
    font-size: 2.2rem;
    font-weight: bold;
    position: relative;
    margin-top: 0;
    margin-bottom: 15px; /* Adjusted spacing below title */
    color: #00a8ff;
    -webkit-text-stroke: 1px black; /* Outline effect */
    text-shadow: 0px 0px 5px #00a8ff, 0px 0px 4px #0077cc; /* Glow effect */
}

/* API Key Status Message Area */
#fairFightApiKeyError { /* Specific ID for this page's API key status */
    color: #f39c12; /* Caution orange */
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 5px;
    margin-bottom: 20px; /* Space below this message */
    text-align: center;
    min-height: 1.2em; /* Ensures consistent spacing when empty */
}

/* Container for Individual and Faction Search Boxes */
.stats-container {
    display: flex;
    justify-content: center; /* Centers boxes horizontally */
    align-items: stretch; /* Makes boxes same height */
    gap: 30px; /* Space between boxes */
    max-width: 100%;
    margin: 30px auto 0 auto; /* Space above, and centers the container */
    flex-wrap: wrap; /* Allows boxes to wrap to next line on smaller screens */
}

/* Styling for Individual and Faction Search Boxes */
.battle-stats-box, .faction-search-box {
    flex: 1 1 300px; /* Allows boxes to grow/shrink, minimum width 300px */
    max-width: 420px; /* Max width for each box */
    min-height: 240px; /* Ensures consistent height across boxes */
    padding: 25px;
    box-sizing: border-box; /* Includes padding in width/height */
    background-color: rgba(43, 43, 43, 0.8); /* Semi-transparent dark background */
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 168, 255, 0.3); /* Blue glow effect */
    text-align: center;
    display: flex;
    flex-direction: column; /* Stacks contents vertically */
    justify-content: space-between; /* Pushes button to bottom if text content is short */
}
.battle-stats-box h3, .faction-search-box h3 {
    color: #00a8ff;
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 10px;
}
.battle-stats-box p, .faction-search-box p {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 15px;
    flex-grow: 1; /* Allows paragraph to take up available space */
    display: flex;
    align-items: center; /* Vertically centers text if it's short */
    justify-content: center; /* Horizontally centers text */
}

/* Input fields within the boxes */
.battle-stats-box input[type="text"],
.faction-search-box input[type="text"] {
    width: 100%;
    height: 38px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 1rem;
    border: 1.5px solid #007acc; /* Blue border */
    background-color: #121212; /* Dark background */
    color: #eee;
    text-align: center;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.battle-stats-box input[type="text"]:focus,
.faction-search-box input[type="text"]:focus {
    outline: none;
    border-color: #00b0ff;
    box-shadow: 0 0 8px #00b0ff;
}

/* General Error messages for inputs */
.error-message {
    color: #f39c12; /* Caution orange */
    font-size: 0.85rem;
    font-weight: bold;
    margin-top: 5px;
    text-align: center;
    min-height: 1.2em; /* Ensures consistent spacing even when empty */
    width: 100%;
}

/* Fetch Buttons */
.fetch-btn {
    display: block;
    width: 180px;
    padding: 10px 16px;
    background-color: #28a745; /* Green */
    color: black;
    font-size: 1rem;
    font-weight: bold;
    border: 2px solid black; /* Black outline */
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.5);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.1s ease;
    margin: 15px auto 0 auto; /* Centers button horizontally */
    text-align: center;
}
.fetch-btn:hover {
    background-color: #218838;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.7);
    transform: translateY(-1px);
}
/* Reused action-btn styles for download button */
.action-btn.download-btn { background-color: #00a8ff; color: #222; border: 2px solid #000; }
.action-btn.download-btn:hover { background-color: #0086d1; }


/* Inline status messages (e.g., "Fetching...") */
.results-inline-status {
    font-size: 0.9rem;
    margin-top: 10px;
    color: #ffcc00; /* Yellow/Orange for status */
    min-height: 1.2em;
}

/* Disclaimer text at bottom of container */
.note {
    text-align: center;
    font-size: 0.9rem;
    color: #f39c12; /* Caution orange */
    padding: 0px;
    margin-top: 60px; /* Adjusted to move it down */
    margin-bottom: 0;
}
.note p {
    color: #f39c12; /* Caution orange */
    font-weight: bold;
    margin-top: 0; /* Ensures consistent spacing with parent .note */
    font-size: 0.9em;
}

/* General Error for main input fields (if it appears from JS) */
.main-input-error-feedback {
    color: #f39c12; /* Caution orange */
    background-color: rgba(243, 156, 18, 0.15); /* Orange background tint */
    border-color: #f39c12; /* Orange border */
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
}

/* MODAL TABLE STYLES (Specific to modals displayed by this tool) */
.modal-table-container {max-height: calc(90vh - 200px);overflow-y: auto;border: 1px solid #007acc;border-radius: 8px;margin-top: 15px;}
.modal-table {width: 100%;border-collapse: collapse;margin: 0;background-color: #1c1c1c;}
.modal-table thead th {
    background-color: #007acc;color: black; /* Headers are black as requested */padding: 12px 15px;text-align: left;
    border: 1px solid #005f99;position: sticky;top: 0;z-index: 10; font-size: 0.95rem;
}
.modal-table tbody tr:nth-child(even) {background-color: #2a2a2a;}
.modal-table tbody tr:nth-child(odd) {background-color: #333;}
.modal-table tbody td {padding: 10px 15px;border: 1px solid #444;color: #eee;font-size: 0.9rem;text-align: left;}
.modal-table tbody tr:hover {background-color: #404040;}

/* Add this new rule for the modal content */
.modal-content { /* Adjust this selector if your modal content has a different class/ID */
    width: 90%; /* Increase width, e.g., to 90% of the screen */
    max-width: 1200px; /* Or set a fixed max-width like 1200px to ensure it doesn't get too wide on very large screens */
    /* You might also need to adjust max-height if the table gets very long, but width is the primary concern here */
}

/* Also, ensure the modal table container doesn't restrict width too much */
.modal-table-container {
    /* Remove or increase any max-width property if it's present and too restrictive. */
    /* The width of the modal-table itself should already be 100% of its container */
    max-height: calc(90vh - 200px); /* Keep the max-height for vertical scrolling if needed */
    overflow-x: hidden; /* Hide horizontal scroll on the table container itself */
}

/* Responsive Media Queries (Specific to tool containers) */
@media (max-width: 768px) {
    /* Main Peeper Tool Container - Overall Box */
       
	
	 /* NEW: Rule to prevent the whole page from scrolling on mobile only */
    html, body {
        overflow-y: hidden !important;
   
    }
    
    /* The main description paragraph */
    .peeper-tool-container p {
        margin-bottom: 20px;
    }
    
    .stats-container {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }
    
    .battle-stats-box, .faction-search-box {
        max-width: 90%;
        width: 100%;
        min-height: auto;
    }
    
    .battle-stats-box p, .faction-search-box p {
        min-height: 50px;
    }
    
    .note {
        text-align: center;
        font-size: 0.9rem;
        color: #f39c12; /* Caution orange */
        padding: 0px;
        margin-top: 20px;
        margin-bottom: 0;
    }
    
    .image-glow, .image-glow-flipped {
        display: none; /* Hide glow images on smaller screens */
    }
    
    /* NEW: Make the modal content and table responsive */
    .modal-content {
        width: 95% !important; /* Make the modal itself a bit narrower */
        margin: auto !important;
    }
    .modal-table-container {
        max-height: calc(90vh - 150px) !important; /* Adjust height for modal on mobile */
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch; /* Add smooth scrolling on iOS */
    }
    .modal-table thead th, .modal-table tbody td {
        padding: 5px 8px !important; /* Reduce padding to make columns narrower */
        font-size: 0.75rem !important; /* Reduce font size for readability on mobile */
        white-space: nowrap; /* Prevent content from wrapping */
    }
    .modal-table thead th {
        font-size: 0.8rem !important; /* Keep header font slightly larger */
    }
}
@media (max-width: 480px) {
    .peeper-tool-container { margin: 10px auto; padding: 15px; width: 95%;}
    .script-title { font-size: 1.6rem; }
    .battle-stats-box, .faction-search-box { max-width: 95%; }
    .fetch-btn { width: 160px; padding: 8px 12px; font-size: 0.9rem; }
}

/* Also, ensure the modal table container doesn't restrict width too much */
.modal-table-container {
    /* FIX: Change overflow to auto to allow horizontal scrolling on mobile */
    max-height: calc(90vh - 200px); 
    overflow-x: auto; 
}

@media (min-width: 769px) and (max-width: 1024px) {
  .peeper-tool-container {
    max-width: 700px !important;
    padding: 10px 20px;
    margin-top: 100px !important;
    margin-left: auto !important; /* Explicitly re-center */
    margin-right: auto !important; /* Explicitly -center */
  }
  
  .image-glow, {
  display: none;
  }
}