/* global.css – Sarasota Paint Portal theme */

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: #f5f6f8;
  color: #222;
}

/* ===== Header ===== */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1f3a60; /* deep blue */
  color: #fff;
  padding: 0.5em 1em;
}

.portal-brand .brand-name {
  font-weight: bold;
  font-size: 1.2em;
}

.portal-nav a {
  color: #cfd8e3;
  margin: 0 0.75em;
  text-decoration: none;
  font-weight: 500;
}

.portal-nav a:hover,
.portal-nav a.active {
  color: #fff;
  border-bottom: 2px solid #ffcc00; /* highlight */
}

.portal-user {
  font-size: 0.9em;
}

.portal-user .logout {
  color: #ffcc00;
  margin-left: 1em;
  text-decoration: none;
}

.portal-user .logout:hover {
  text-decoration: underline;
}

/* ===== Layout ===== */
.portal-main {
  padding: 1em;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1em;
  margin-bottom: 1em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ===== Buttons ===== */
button,
input[type=submit] {
  background: #1f3a60;
  color: #fff;
  padding: 0.5em 1em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover,
input[type=submit]:hover {
  background: #264b80;
}

/* Small pagination buttons */
.btn-small {
  background: #1f3a60;
  color: #fff;
  padding: 0.3em 0.6em;
  font-size: 0.85em;
  border-radius: 4px;
  text-decoration: none;
  margin: 0 3px;
}

.btn-small:hover {
  background: #264b80;
}

/* ===== Inputs ===== */
input, select {
  padding: 0.5em;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

/* ===== Footer ===== */
.portal-footer {
  background: #1f3a60;
  color: #cfd8e3;
  padding: 1em 0;
  text-align: center;
  font-size: 0.9em;
  margin-top: 2em;
}

.portal-footer a {
  color: #ffcc00;
  text-decoration: none;
}

.portal-footer a:hover {
  text-decoration: underline;
}

/* ===== Global link styles ===== */
a {
  color: #1f3a60;          /* deep blue */
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  color: #264b80;
  text-decoration: underline;
}

/* Ensure .btn links keep button style */
a.btn {
  color: #fff !important;
  text-decoration: none !important;
}

/* ===== Login ===== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 1em;
  box-sizing: border-box;
}

.login-card {
  background: #fff;
  border-radius: 8px;
  padding: 1.5em;
  margin: 1em auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 420px;
  text-align: left;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 1em;
  font-size: 1.3em;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}

.remember {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.85rem;
  color: #444;
  margin: 0.5em 0;
}

.remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #1f3a60;
}

.remember label {
  margin: 0;
  cursor: pointer;
}

/* Mobile tweaks for login */
@media (max-width: 480px) {
  .login-card {
    margin: 0.5em;
    padding: 1em;
  }
  .login-card h2 {
    font-size: 1.1em;
  }
  .login-card input,
  .login-card button {
    font-size: 1em;
  }
  .remember {
    font-size: 0.8rem;
  }
}

/* ===== Support Module ===== */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.tab {
  padding: 8px 12px;
  border: 1px solid #ccc;
  cursor: pointer;
  background: #f9f9f9;
}
.tab.active {
  background: #2563eb;
  color: #fff;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  table-layout: fixed;   /* ✅ keeps consistent size */
}
.ticket-table th,
.ticket-table td {
  border: 1px solid #ccc;
  padding: 6px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticket-table th {
  background: #f3f4f6;
}

.comment-box {
  border: 1px solid #ddd;
  padding: 0.75em;
  margin: 0.5em 0;
  background: #fafafa;
  border-radius: 6px;
  word-wrap: break-word;
}

.comment-form {
  margin-top: 1em;
}

.comment-textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 0.5em;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

@media (max-width: 600px) {
  .comment-textarea {
    font-size: 0.95em;
    min-height: 100px;
  }
}

/* ===== Ticket Styling ===== */
.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f3f4f6;
  padding: 0.5em 0.8em;
  border-radius: 6px 6px 0 0;
  margin: -1em -1em 1em -1em; /* stretch across card */
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 600;
  color: #fff;
}

.status-open { background: #16a34a; }        /* green */
.status-in_progress { background: #2563eb; } /* blue */
.status-on_hold { background: #6b7280; }     /* gray */
.status-closed { background: #374151; }      /* dark gray */
.status-stale { background: #b91c1c; }       /* red (stale open/in_progress) */
.status-deleted { background: #9ca3af; }     /* light gray for deleted */

/* Closed ticket card */
.ticket-closed {
  background: #f9fafb !important;
  color: #6b7280;
}

/* ===== Dashboard ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin: 30px auto;
  max-width: 1000px;
  padding: 0 20px;
}

.module-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  text-decoration: none;
  color: #222;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  font-size: 1.1em;
}

.module-card:hover {
  background: #f3f4f6;
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

.module-card .emoji {
  font-size: 1.8em;
  margin-bottom: 10px;
}

/* ===== Flash Messages ===== */
.flash-box {
  max-width: 420px;
  margin: 20px auto;
  padding: 12px 18px;
  font-weight: 600;
  text-align: center;
  border-radius: 8px;
}
.flash-success {
  background: #dcfce7;
  border: 1px solid #16a34a;
  color: #166534;
}
.flash-error {
  background: #fee2e2;
  border: 1px solid #dc2626;
  color: #b91c1c;
}
.flash-info {
  background: #e0f2fe;
  border: 1px solid #0284c7;
  color: #075985;
}
.flash-default {
  background: #f3f4f6;
  border: 1px solid #9ca3af;
  color: #111827;
}

/* ===== Profile Page ===== */
.profile-card {
  max-width: 500px;
  margin: 0 auto;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.profile-form .form-row {
  display: flex;
  flex-direction: column;
}

.profile-form label {
  font-weight: 600;
  margin-bottom: 4px;
  color: #1f3a60;
}

.profile-form input {
  padding: 0.6em;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1em;
  width: 100%;
}

.profile-form input:focus {
  border-color: #1f3a60;
  outline: none;
  box-shadow: 0 0 0 2px rgba(31,58,96,0.2);
}

.profile-form .form-actions {
  text-align: right;
}

.profile-form button {
  font-size: 1em;
  padding: 0.6em 1.2em;
}

@media (max-width: 480px) {
  .profile-card {
    margin: 0.5em;
    padding: 1em;
  }
  .profile-form label {
    font-size: 0.9em;
  }
  .profile-form input {
    font-size: 0.95em;
  }
  .profile-form button {
    width: 100%;
    margin-top: 0.5em;
  }
}

/* ===== Support Tickets Responsive ===== */
@media (max-width: 600px) {
  /* Stack filter + new ticket button vertically */
  .card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75em;
  }

  .card form,
  .card .btn,
  .card button {
    width: 100%;
  }

  /* ✅ Turn table into stacked cards */
  .ticket-table,
  .ticket-table thead,
  .ticket-table tbody,
  .ticket-table th,
  .ticket-table td,
  .ticket-table tr {
    display: block;
    width: 100%;
  }

  .ticket-table thead {
    display: none; /* hide headers */
  }

  .ticket-table tr {
    margin-bottom: 1em;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.5em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }

  .ticket-table td {
    border: none;
    padding: 6px 8px;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .ticket-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #1f3a60;
    margin-right: 0.5em;
    flex-shrink: 0;
  }
}

/* ===== New Ticket (Mobile tweaks) ===== */
@media (max-width: 480px) {
  .card form.profile-form {
    gap: 0.8em;
  }

  .card form.profile-form label {
    font-size: 0.9em;
  }

  .card form.profile-form input,
  .card form.profile-form textarea,
  .card form.profile-form select {
    font-size: 0.95em;
    width: 100%;
  }

  .card .form-actions {
    flex-direction: column;
    gap: 0.6em;
    align-items: stretch;
  }

  .card .form-actions .btn,
  .card .form-actions .btn-small {
    width: 100%;
    text-align: center;
  }

  .flash-box {
    max-width: 100%;
    margin: 10px 0;
    font-size: 0.9em;
    padding: 10px 14px;
  }
}
/* ===== Support Ticket View Responsive ===== */
@media (max-width: 600px) {
  /* Make forms stack nicely */
  form {
    width: 100%;
  }

  select,
  textarea,
  input[type=text] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Action buttons wrap full width on mobile */
  .comment-form div {
    flex-direction: column;
    gap: 0.5em;
    width: 100%;
  }

  .comment-form button,
  form button,
  form .btn-small {
    width: 100%;
  }
}
/* Hide desktop nav + user on mobile */
@media (max-width: 768px) {
  .portal-nav,
  .portal-user {
    display: none;
  }
  .mobile-menu a,
  .mobile-menu .portal-user a {
    color: #fff;
  }
}
/* Make page use full height */
html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Let main grow to push footer down */
.portal-main {
  flex: 1;   /* ✅ no display:flex, no column */
}

/* === Support / Portal Tables === */
.ticket-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ticket-table th,
.ticket-table td {
  padding: 0.5em;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.ticket-table th {
  background: #1f3a60;       /* Sarasota blue */
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  z-index: 5;
}

.ticket-table tr:nth-child(even) td {
  background: #f7f9fb;
}

.ticket-table tr:hover td {
  background: #eef3ff;
}

.status-stale td {
  background: #fff8e1 !important;
}

/* === Support / Portal Tables === */
.ticket-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ticket-table th,
.ticket-table td {
  padding: 0.5em;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.ticket-table th {
  background: #1f3a60;       /* Sarasota blue */
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  z-index: 5;
}

/* alternating row colors */
.ticket-table tr:nth-child(even) td {
  background: #f7f9fb;
}

/* hover effect */
.ticket-table tr:hover td {
  background: #eef3ff;
}

/* stale ticket highlight */
.status-stale td {
  background: #fff8e1 !important;
}

