/* ---
  dark-hacker.css
  A retro/BBS dark-mode theme
--- */

/* 1. General Styles & Fonts */
:root {
  --background-color: #0d0d0d;
  --text-color: #e0e0e0;
  --primary-accent: #00ff41; /* Phosphor Green */
  --secondary-accent: #ff00ff; /* Magenta */
  --comment-bg: #1a1a1a;
  --border-color: #333333;
  --glow-color: rgba(0, 255, 65, 0.5);
  --font-main: 'Inconsolata', monospace;
  --font-secondary: 'Syne', sans-serif;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-main);
  line-height: 1.7;
  /* Subtle scanline effect */
  background-image: linear-gradient(rgba(0,0,0,0.3) 50%, transparent 50%);
  background-size: 100% 4px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

h1, h4 {
  font-family: var(--font-secondary);
  text-align: center;
  color: var(--primary-accent);
  text-shadow: 0 0 5px var(--glow-color);
  letter-spacing: 2px;
  text-transform: uppercase;
}

hr {
  border: 0;
  height: 1px;
  background-image: linear-gradient(to right, transparent, var(--primary-accent), transparent);
}

a {
  color: var(--secondary-accent); /* Magenta */
  text-decoration: underline;
  text-decoration-style: solid;
  transition: all 0.2s ease-in-out;
}

.admin-reply a:hover {
  color: #00ffff; /* Cyan */
  text-decoration-style: dotted;
}

/* 2. Forms, Inputs & Buttons */
textarea,
input[type="number"] {
  background-color: var(--comment-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  width: 100%;
  font-family: var(--font-main);
  font-size: 1rem;
  border-radius: 0;
  transition: border-color 0.3s, box-shadow 0.3s;
}

textarea:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 10px var(--glow-color);
  background-color: var(--comment-bg);
  color: var(--text-color);
}
#charCount {
  font-family: var(--font-main);
  color: var(--primary-accent);
  margin-bottom: 10px;
  text-align: right;
}

button {
  background: transparent;
  color: var(--primary-accent);
  border: 1px solid var(--primary-accent);
  padding: 0.75em 1.5em;
  font-family: var(--font-main);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

button:hover {
  background-color: var(--primary-accent);
  color: var(--background-color);
  box-shadow: 0 0 15px var(--glow-color);
}

#askbtn {
  font-family: var(--font-secondary);
  font-weight: bold;
  font-size: 24px;
  min-width: 5em;
}

#adminLoginBtn {
    position: absolute;
    top: 1em;
    right: 1em;
    background-color: transparent;
    color: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 0.5em;
    line-height: 1;
}
#adminLoginBtn:hover {
    color: var(--primary-accent);
    border-color: var(--primary-accent);
}

/* --- NEW: Styles for Sort Dropdown --- */
.sort-container {
    margin-bottom: 1.5rem;
    text-align: right;
}

.sort-container label {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-right: 0.5rem;
}

.sort-container select {
    background-color: var(--comment-bg);
    color: var(--primary-accent);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.5rem;
    font-family: var(--font-main);
    font-size: 0.9rem;
    border-radius: 0;
    -webkit-appearance: none; /* Removes default browser styling */
    -moz-appearance: none;
    appearance: none;
    /* Custom arrow */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300FF41%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 0.7em top 50%, 0 0;
    background-size: 0.65em auto, 100%;
    padding-right: 2em; /* Make space for arrow */
}

.sort-container select:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 10px var(--glow-color);
}
/* --- END: Sort Dropdown Styles --- */


/* 3. Comment Display */
.comment {
  background-color: var(--comment-bg);
  padding: 15px;
  margin-bottom: 15px;
  border-left: 3px solid var(--primary-accent);
  word-wrap: break-word; /* Prevents long strings from breaking layout */
}

.comment-date,
.timezone {
  font-size: 0.8em;
  color: #888;
}

.admin-reply, .reply {
  background-color: #1c001c; /* Dark Magenta BG */
  border-left: 3px solid var(--secondary-accent);
  padding: 10px;
  margin-top: 10px;
  border-radius: 0;
  color: #f0f0f0;
}
.admin-reply p, .reply div, .reply p {
  margin: 0.5em 0;
}
.admin-reply a {
  color: var(--primary-accent);
  text-decoration: underline;
}
.admin-reply strong, .reply strong {
    color: var(--secondary-accent);
}

/* --- NEW STYLES FOR LIKE FEATURE --- */
.comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.comment-footer .comment-date {
    margin: 0; /* Removes default paragraph margin */
}

.like-section {
    display: flex;
    align-items: center;
    gap: 8px; /* Adds space between button and count */
}

.like-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 4px; /* Adjusted padding for the icon */
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    /* Overriding general button styles for a smaller button */
    font-family: var(--font-main);
    display: flex; /* Center the SVG icon */
    align-items: center;
    justify-content: center;
    line-height: 1; /* Ensure consistent height */
    width: 28px; /* Fixed width */
    height: 28px; /* Fixed height */
}

.like-btn svg {
    fill: var(--text-color);
    transition: fill 0.2s;
}

.like-btn:hover {
    background-color: var(--primary-accent);
    border-color: var(--primary-accent);
    box-shadow: 0 0 8px var(--glow-color); /* Subtle glow on hover */
}

.like-btn:hover svg {
    fill: var(--background-color);
}

.like-count {
    font-family: var(--font-main);
    color: var(--primary-accent);
    font-weight: bold;
    min-width: 20px; /* Prevents layout shift when numbers change */
    text-align: right;
    font-size: 0.9rem;
}

/* Animation for the button click */
@keyframes punchy-pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.6) rotate(-10deg); /* Scale up more, rotate slightly */
    }
    100% {
        transform: scale(1);
    }
}

.like-btn.clicked {
    animation: punchy-pop 0.3s ease-out; /* Faster duration */
}

/* --- END NEW STYLES --- */


/* 4. Admin Page Specifics */
.admin-actions {
  margin-top: 10px;
  border-top: 1px dashed var(--border-color);
  padding-top: 10px;
}
.edit-form {
    border: 1px dashed var(--border-color);
    padding: 10px;
    margin-top: 10px;
    display: none;
}
em {
    color: #aaa;
}

/* 5. Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    .container {
        padding: 0.5rem;
    }
    h1 {
        font-size: 1.8rem;
    }
    #askbtn {
        font-size: 20px;
        width: 100%;
    }
    #adminLoginBtn {
        position: static;
        float: right;
        margin-bottom: 1rem;
    }
}


/* 6. Header / Top Bar Styles */
.top-bar {
    /* The background-color and padding have been removed to inherit from your main site styles */
    font-family: var(--font-secondary);
}

.top-bar ul, .top-bar ul.menu {
    background: none; /* Ensures the menu background is transparent */
}

/* Use a more specific selector to override framework styles */
.top-bar .menu a {
    /*color: var(--text-color);*/
    text-decoration: none !important; /* No underline */
    transition: color 0.2s ease-in-out;
}

/* Use a more specific selector for the hover effect */
.top-bar .menu a:hover {
    color: var(--primary-accent) !important; /* Green on hover */
    background: none; /* Ensure no background color changes on hover */
}
