/**
 * custom.css (v2.6 - Fixed sidebar hover/active states)
 *
 * Contains the minimal, essential styles for the site's dark theme,
 * accent colors, and shared components like cards, forms, and navbars.
 */

/* ==================================
   1. Core Theme & Dark Mode
   ================================== */
html, body {
    background-color: #1E1E1E;
    color: #FFFFFF; /* Default text color for inheritance */
    font-family: 'Roboto', sans-serif;
}

/* Set specific text colors to override Bootstrap defaults */
h1, h2, h3, h4, h5, h6,
p, label, li, dt, dd {
    color: #FFFFFF;
}

/* General link styling. Buttons and special links will override this. */
a {
    color: var(--accent-color, #DEB887);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Scrollbar Styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #333333; }
::-webkit-scrollbar-thumb { background-color: #555555; border-radius: 4px; }

/* ==================================
   2. Accent Color Theme Classes
   ================================== */
/* Light Backgrounds -> Dark Text */
.theme-burlywood { --accent-color: burlywood; --accent-color-rgb: 222, 184, 135; --accent-text-color: #000; }
.theme-lightcoral { --accent-color: lightcoral; --accent-color-rgb: 240, 128, 128; --accent-text-color: #000; }
.theme-lightgreen { --accent-color: lightgreen; --accent-color-rgb: 144, 238, 144; --accent-text-color: #000; }
.theme-plum { --accent-color: plum; --accent-color-rgb: 221, 160, 221; --accent-text-color: #000; }
.theme-thistle { --accent-color: thistle; --accent-color-rgb: 216, 191, 216; --accent-text-color: #000; }
.theme-tomato { --accent-color: tomato; --accent-color-rgb: 255, 99, 71; --accent-text-color: #000; }
.theme-violet { --accent-color: violet; --accent-color-rgb: 238, 130, 238; --accent-text-color: #000; }

/* Dark Backgrounds -> Light Text */
.theme-cadetblue { --accent-color: cadetblue; --accent-color-rgb: 95, 158, 160; --accent-text-color: #FFF; }
.theme-cornflowerblue { --accent-color: cornflowerblue; --accent-color-rgb: 100, 149, 237; --accent-text-color: #FFF; }
.theme-dodgerblue { --accent-color: dodgerblue; --accent-color-rgb: 30, 144, 255; --accent-text-color: #FFF; }


/* ==================================
   3. Shared Components
   ================================== */

/* --- Navbar & Footer --- */
.navbar {
    border-bottom: 2px solid var(--accent-color, #DEB887);
}
.navbar-brand span {
    color: #FFFFFF;
}

footer {
    border-top: 2px solid var(--accent-color, #DEB887);
}

/* --- Cards --- */
.card {
    background-color: #2a2a2a;
    border: 1px solid #444;
}
.card .card-title, .card .card-text, .card .card-body {
    color: #fff;
}
.card-link {
    text-decoration: none !important;
}
.hover-accent {
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-accent:hover {
    border-color: var(--accent-color, #DEB887) !important;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* --- Dropdown Menus --- */
.dropdown-menu {
  background-color: #2a2a2a;
  border: 1px solid #444;
}
.dropdown-item {
  color: #fff;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background-color: #3a3a3a;
  color: #fff !important;
}


/* ==================================
   4. Form Controls
   ================================== */
.form-control, .form-select {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border: 1px solid #444 !important;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent-color, #DEB887) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--accent-color-rgb, 222, 184, 135), 0.35) !important;
    background-color: #2a2a2a !important;
    color: #ffffff !important;
}
.form-check-input:checked {
    background-color: var(--accent-color, #DEB887);
    border-color: var(--accent-color, #DEB887);
}
.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--accent-color-rgb, 222, 184, 135), 0.35) !important;
}

/* ==================================
   5. Buttons & Icons
   ================================== */

.btn-task {
    background-color: var(--accent-color, #DEB887);
    border-color: var(--accent-color, #DEB887);
    color: var(--accent-text-color, #000);
}
.btn-task:hover {
    filter: brightness(0.9);
    color: var(--accent-text-color, #000);
}

.btn .material-icons {
    font-size: 1.2em;
    vertical-align: text-bottom;
}


/* ==================================
   6. Sidebar
   ================================== */
a.nav-link { 
    color: var(--accent-color, #DEB887);
}
.sidebar a.nav-link {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #444;
    transition: background-color 0.2s ease, color 0.2s ease, filter 0.2s ease;
}
.sidebar a.nav-link:last-child {
    border-bottom: none;
}
.sidebar .material-icons {
    font-size: 24px;
    width: 28px;
    text-align: center;
}
.sidebar img.icon {
    height: 24px;
    width: 24px;
    object-fit: contain;
}

/* ==================================
   7. Active & Hover State Styling
   ================================== */
.sidebar a.nav-link.active {
    background-color: var(--accent-color, #DEB887);
    color: var(--accent-text-color, #000) !important; /* !important to override default blue */
    font-weight: bold;
}

/* On hover, apply the active styles, but also darken slightly if it's NOT the active link */
.sidebar a.nav-link:hover {
    background-color: var(--accent-color, #DEB887);
    color: var(--accent-text-color, #000) !important;
    text-decoration: none;
}

.sidebar a.nav-link:not(.active):hover {
    filter: brightness(90%);
}


/* ==================================
   8. Utilities
   ================================== */
#toastContainer {
    z-index: 1100;
}
/* ==================================
   9. Color Combinations Tool
   ================================== */
.color-swatch {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.color-swatch .text-value {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    font-size: 1.1rem;
}

.color-swatch .hex-value {
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    line-height: 1.4;
    color: inherit; /* Inherits the high-contrast text color */
}

/* Style for the <input type="color"> */
.form-control-color {
    min-width: 50px;
    height: calc(1.5em + .75rem + 2px); /* Match default Bootstrap input height */
    padding: .375rem .75rem;
    cursor: pointer;
    background-color: transparent; /* Allows its own color to show */
    border: 1px solid #444; /* Match other form controls */
}

.form-control-color:focus {
     border-color: var(--accent-color, #DEB887) !important;
     box-shadow: 0 0 0 0.25rem rgba(var(--accent-color-rgb, 222, 184, 135), 0.35) !important;
}

/* Ensure the text input next to the color picker has rounded corners */
.input-group > .form-control-color + .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Accessibility Enhancement for Color Combinations Tool */
.card .text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}
.btn-edit {
    background-color: #6c757d; /* A neutral gray for secondary actions */
    border-color: #6c757d;
    color: #ffffff;
}
.btn-edit:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: #ffffff;
}

.btn-clear {
    background-color: transparent;
    border-color: #6c757d; /* A gray outline for tertiary/clearing actions */
    color: #adb5bd;
}
.btn-clear:hover {
    background-color: #6c757d;
    color: #ffffff;
}
/* ==================================
   10. Text-to-Speech Tool
   ================================== */
#text-to-speak {
    min-height: 200px;
}

.tts-tool-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* SSML tag styling */
.ssml-tag {
    color: var(--accent-color);
    background-color: rgba(var(--accent-color-rgb), 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}