/* Shared styles for all pages, including view.php and apidoc.php */
/* Dark theme with high contrast: light text on dark background */

body {
    background-color: #1e1e1e; /* Dark gray background */
    color: #e0e0e0; /* Light gray text for readability */
    font-family: Arial, sans-serif;
    margin: 20px;
}

.container {
    max-width: 70vw; /* Narrower width */
    margin: 0 auto;
}

h1, h2, h3 {
    color: #ffffff; /* White for headings */
    text-align: center; /* Center headings */
}

table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 20px;
}

th, td {
    border: 1px solid #444444; /* Darker border */
    padding: 8px;
    color: #e0e0e0; /* Light text */
    text-align: left;
}

th {
    background-color: #333333; /* Dark header background */
}

td {
    background-color: #252525; /* Slightly lighter than body for distinction */
}

pre {
    background-color: #2d2d2d; /* Dark code background */
    padding: 10px;
    overflow: auto;
    color: #e0e0e0; /* Light text */
    border: 1px solid #444444;
}

code {
    color: #e0e0e0; /* Light code text */
    font-family: monospace;
}

/* Specific for paste code in view.php */
pre.paste-code {
    /* max-width removed, handled by container */
}

pre.wrap {
    white-space: pre-wrap;
    word-break: break-all;
}

pre.no-wrap {
    white-space: pre;
    overflow-x: auto;
}

/* Styles for buttons in general */
button {
    padding: 8px 12px;
    margin-right: 5px;
    background-color: #333333; /* Dark button background */
    border: 1px solid #444444;
    color: #e0e0e0; /* Light text */
    cursor: pointer;
}

button:hover {
    background-color: #444444; /* Lighter on hover for feedback */
}

.tooltip {
    display: none;
    background-color: #000000; /* Black tooltip */
    color: #ffffff; /* White text */
    padding: 5px;
    border-radius: 3px;
    position: absolute;
}

.tooltip.show {
    display: inline-block;
}

/* Styles for buttons container in view.php (floating bottom right) */
.buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000; /* Ensure on top */
    display: flex;
    flex-direction: row; /* Inline buttons */
    align-items: center;
}

/* Styles for tabs in apidoc.php */
.tabs {
    overflow: hidden;
    border-bottom: 1px solid #444444;
    margin-bottom: 10px;
    text-align: center; /* Center tabs if desired */
}

.tabs button {
    background-color: #333333;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 16px;
    transition: 0.3s;
    color: #e0e0e0;
    margin-right: 5px;
}

.tabs button:hover {
    background-color: #444444;
}

.tabs button.active {
    background-color: #252525;
}

.tabcontent {
    display: none;
}

.tabcontent .buttons {
    margin-top: 10px;
    position: static; /* Override fixed for apidoc buttons */
    display: block; /* Or flex if needed */
    text-align: left; /* Adjust as needed */
}

/* Add for header */
header {
    background-color: #333333;
    padding: 10px;
    text-align: center;
}

header h1 {
    margin: 0;
}

nav {
    margin-top: 10px;
}

nav a, nav span {
    margin: 0 10px;
    text-decoration: none;
}

nav a {
    color: #ffffff !important; /* White text for non-active, !important to override general a */
    background-color: #1B5E20; /* Darker green background */
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

nav a:hover {
    background-color: #2E7D32; /* Lighter green on hover */
    color: #ffffff !important; /* Maintain white text on hover */
}

nav a.active {
    background-color: #2E7D32; /* Darker green for active */
    color: #FFCA28 !important; /* Yellow text for active page */
}

nav a.active:hover {
    background-color: #388E3C; /* Even lighter green on active hover */
    color: #FFE082 !important; /* Lighter yellow on active hover */
}

nav a:hover {
    text-decoration: none; /* No underline on hover for nav */
}

/* General link styling: uniform color, no visited difference, hover effect */
a {
    color: #a0c4ff; /* Light blue for visibility on dark bg */
    text-decoration: none;
}

a:hover {
    color: #ffffff; /* White on hover */
    text-decoration: underline;
}

a:visited {
    color: #a0c4ff; /* Same as unvisited */
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    max-width: 400px;
    margin: 0 auto;
}

/* Improved form alignment: labels above inputs for clean stacking */
form label {
    display: block;
    margin-bottom: 5px; /* Space between label text and input */
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea,
form select {
    background-color: #2d2d2d; /* Dark input background to match theme */
    color: #e0e0e0; /* Light text */
    border: 1px solid #444444; /* Subtle border */
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px; /* Space between inputs */
    /* Prevent browser-specific autofill styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Override autofill background for Chrome/Safari */
    -webkit-box-shadow: 0 0 0 1000px #2d2d2d inset;
    box-shadow: 0 0 0 1000px #2d2d2d inset;
    /* Override autofill text color */
    -webkit-text-fill-color: #e0e0e0;
}

/* Specific handling for autofilled inputs in Chrome/Safari */
form input:-webkit-autofill,
form input:-webkit-autofill:hover,
form input:-webkit-autofill:focus,
form input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #2d2d2d inset !important;
    -webkit-text-fill-color: #e0e0e0 !important;
    background-color: #2d2d2d !important;
    border: 1px solid #444444 !important;
}

form textarea {
    height: 200px; /* Default height for content areas; adjustable */
    resize: vertical; /* Allow vertical resize */
}

form button {
    width: auto; /* Buttons don't need full width */
    align-self: center; /* Center submit button */
}

/* Suggestions dropdown for format input */
.format-wrapper {
    position: relative;
    margin-bottom: 15px; /* Space below wrapper */
}

#suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #2d2d2d;
    border: 1px solid #444444;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none; /* Hidden by default; shown via JS */
}

#suggestions p {
    padding: 8px;
    margin: 0;
    cursor: pointer;
}

#suggestions p:hover {
    background-color: #444444;
}

/* Stats section for profile */
.stats {
    background-color: #252525;
    padding: 10px;
    border: 1px solid #444444;
    margin-bottom: 20px;
    border-radius: 5px;
}

.stats p {
    margin: 5px 0;
}
