/* Extracted from base.html */

/* Login Page Enhancement */
.login-page-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 90px; /* navbar height + extra space */
    background: linear-gradient(135deg, #f8fafc 0%, #f47721 8%, #f8fafc 100%);
    z-index: 1000;
}
@media (max-width: 768px) {
  .login-page-container {
    padding-top: 70px;
  }
}

.login-card {
    background: #fff;
    border-radius: 1.2rem;
    padding: 0.7rem 0.7rem 0.6rem 0.7rem;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 4px 32px rgba(244, 119, 33, 0.08), 0 1.5px 8px rgba(0,0,0,0.04);
    border: 1px solid #f6e7d8;
}
.login-card h2 {
    font-size: 1.3rem;
    margin-bottom: 0.7rem;
}
.login-card .mb-3 {
    margin-bottom: 0.6rem !important;
}
.login-card .form-control {
    padding: 0.5rem 0.8rem;
    font-size: 0.98rem;
    margin-bottom: 0.2rem;
}
.login-card .btn-primary,
.login-card .btn-success {
    padding: 0.5rem 0;
    font-size: 1rem;
}
.login-card p {
    margin-top: 0.8rem !important;
    font-size: 0.97rem;
}


body.dark-mode .login-card {
    background: #232323;
    border: 1px solid #444;
    box-shadow: 0 4px 32px rgba(244, 119, 33, 0.14), 0 1.5px 8px rgba(0,0,0,0.18);
}

.login-card .form-label {
    font-weight: 600;
    color: #f47721;
}

.login-card .form-control {
    border-radius: 0.7rem;
    border: 1px solid #e0e0e0;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

body.dark-mode .login-card .form-label {
    color: #f8fafc;
}
body.dark-mode .login-card .form-control {
    background: #232323;
    color: #f8fafc;
    border: 1px solid #555;
}

.login-card .btn-primary {
    background: linear-gradient(90deg, #f47721 0%, #ffb347 100%);
    border: none;
    border-radius: 0.7rem;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.7rem 0;
    box-shadow: 0 2px 8px rgba(244, 119, 33, 0.08);
    transition: background 0.2s;
}
.login-card .btn-primary:hover {
    background: linear-gradient(90deg, #ffb347 0%, #f47721 100%);
}

.login-card a {
    color: #f47721;
    text-decoration: underline;
}
.login-card a:hover {
    color: #d65a00;
    text-decoration: none;
}

body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}
.container-wrapper {
    display: flex;
    flex: 1;
    padding-top: 50px; /* New navbar height */
    padding-left: 240px; /* Width of sidebar */
    padding-bottom: 2rem; /* Only bottom margin for mobile AI message box */
}
@media (max-width: 768px) {
    .container-wrapper {
        padding-left: 0;
        padding-top: 50px;
        padding-bottom: 2.5rem;
    }
}
.content {
    flex: 1;
    padding: 20px;
    /* Adjust margins based on sidebar and AI box visibility */
    margin-left: {% if current_user.is_authenticated %}220px{% else %}20px{% endif %};
    margin-right: {% if current_user.is_authenticated %}220px{% else %}20px{% endif %};
}
.navbar-brand {
    margin-right: auto; /* Push brand to the left */
    color: {% if session.get('dark_mode') %}#f47721{% else %}#f47721{% endif %};
}
.theme-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.4rem;
  border-radius: 1.2rem;
  border: 2px solid #f6e7d8;
  background: #fff;
  box-shadow: 0 2px 8px rgba(244,119,33,0.07);
  min-width: 48px;
  min-height: 2.5rem;
  cursor: pointer;
  transition: background 0.25s, border 0.25s, box-shadow 0.2s;
}
.theme-toggle-container:hover, .theme-toggle-container:focus-within {
  background: #ffe5ca;
  border-color: #f47721;
  box-shadow: 0 4px 16px rgba(244,119,33,0.13);
}
body.dark-mode .theme-toggle-container {
  background: #232323;
  border-color: #444;
  box-shadow: 0 2px 8px rgba(244,119,33,0.12);
}
body.dark-mode .theme-toggle-container:hover, body.dark-mode .theme-toggle-container:focus-within {
  background: #1a1a1a;
  border-color: #f47721;
}
.theme-toggle-label {
  margin-bottom: 0;
  margin-left: 0.4rem;
  color: #f47721;
  font-size: 1.3rem;
  cursor: pointer;
  transition: color 0.25s;
}
body.dark-mode .theme-toggle-label {
  color: #ffb347;
}
#dark-mode-toggle {
  appearance: none;
  width: 2.1rem;
  height: 1.1rem;
  background: #eee;
  border-radius: 1.1rem;
  border: 1.5px solid #f6e7d8;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background 0.25s, border 0.25s;
  margin: 0;
}
#dark-mode-toggle:checked {
  background: #f47721;
  border-color: #f47721;
}
body.dark-mode #dark-mode-toggle {
  background: #333;
  border-color: #444;
}
body.dark-mode #dark-mode-toggle:checked {
  background: #ffb347;
  border-color: #ffb347;
}
#dark-mode-toggle::before {
  content: '';
  position: absolute;
  top: 0.1rem;
  left: 0.15rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: left 0.25s, background 0.25s;
}
#dark-mode-toggle:checked::before {
  left: 1.05rem;
  background: #fff8f2;
}
body.dark-mode #dark-mode-toggle::before {
  background: #232323;
}
body.dark-mode #dark-mode-toggle:checked::before {
  background: #fff8f2;
}

    display: flex;
    align-items: center;
    margin-left: 20px; /* Space from other navbar items */
}
.theme-toggle-label {
    margin-left: 0.5rem;
    font-size: 0.9rem;
    color: {% if session.get('dark_mode') %}#f0f0f0{% else %}#333{% endif %};
}
/* Improved toggle styling */
.form-check-input {
    width: 2.5em;
    height: 1.25em;
    border: 1px solid #ccc;
    border-radius: 1.25em;
    background-color: #fff;
    appearance: none;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
body.dark-mode .form-check-input {
    background-color: #333; /* Dark background for toggle in dark mode */
    border-color: #555;
}
.form-check-input:checked {
    background-color: #f47721;
    border-color: #f47721;
}
.form-check-input::before {
    content: '';
    position: absolute;
    width: 1em;
    height: 1em;
    background-color: #6c757d;
    border-radius: 50%;
    top: 0.125em;
    left: 0.125em;
    transition: transform 0.3s ease;
}
.form-check-input:checked::before {
    transform: translateX(1.25em);
    background-color: #fff;
}
body.dark-mode .form-check-input::before {
    background-color: #d1d1d1; /* Light color for the toggle handle in dark mode */
}
