/* Mitel Forums Master Styles */

* {
  box-sizing: border-box;
}

:root {
  --primary: #334466;
  --bg: #f4f6f8;
  --text: #222;
  --card: #ffffff;
  --border: #d6e0ed;
  --muted: #666;
  --accent: #eef4fb;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  width: 100%;
}

/* Layout Containers */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  width: 100%;
}

.home-header {
  background: var(--primary);
  color: white;
  padding: 40px 16px;
  text-align: center;
}

.topbar {
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  margin-left: 15px;
  font-size: 14px;
}

h1 { font-size: 28px; }
h2 { color: var(--primary); }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin: 14px auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 100%;
  text-align: left;
}

/* Global Buttons */
a.button, 
button.button {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px;
  background: var(--primary);
  color: white !important;
  text-decoration: none;
  font-weight: bold;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  margin-top: 10px;
}

a.button:hover, 
button.button:hover {
  background: #223044;
}

/* Button Fix: Ensures all small buttons are the same height */
.button-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef1f5;
  color: #333;
  border: 1px solid var(--border);
  padding: 8px 16px; /* Standardized padding */
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  height: 38px; /* Fixed height so they always match */
  vertical-align: middle;
}

.button-small:hover {
  background: #e2e8f0;
}

/* Feature Tables */
.feature-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.feature-table th {
  background: var(--primary);
  color: white;
  text-align: left;
  padding: 15px 20px;
}

.feature-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.feature-table tr:nth-child(even) {
  background: #f9fafb;
}

.feature-table td.code {
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  color: var(--primary);
  text-align: right;
  font-size: 18px;
}

/* Tool Specific Styles (Dashboard) */
.dashboard-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.country-toggle {
  display: flex;
  gap: 10px;
  background: #eef1f5;
  padding: 5px;
  border-radius: 8px;
  align-self: flex-start;
}

.country-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  font-weight: bold;
  color: var(--muted);
}

.country-btn.active {
  background: var(--primary);
  color: white;
}

.info-icon {
  cursor: pointer;
  color: var(--primary);
  font-size: 14px;
  margin-left: 8px;
  opacity: 0.7;
}

/* Accordion Styles (For Manuals Page) */
.accordion h2 { cursor: pointer; }
.accordion-content { display: none; margin-top: 15px; border-top: 1px solid #eee; padding-top: 10px; }
.docList { padding-left: 20px; }
.docList li { margin-bottom: 8px; }

/* Modal Popup (Centered) */
.modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  /* Force alignment to center */
  align-items: center;
  justify-content: center;
}

.modal[style*="display: block"] {
  display: flex !important;
}

.modal-content {
  background-color: #fff;
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  position: relative;
}

.close-modal {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

/* Alerts & Feedback */
.alert-box {
  background: var(--accent);
  border-left: 4px solid var(--primary);
  padding: 15px;
  margin-top: 15px;
  border-radius: 4px;
}

.error-msg {
  color: #d9534f;
  background: #fdf7f7;
  padding: 12px;
  border: 1px solid #d9534f;
  border-radius: 6px;
}

/* Utilities */
mark { background: yellow; }
.hidden { display: none !important; }
.no-results { padding: 15px; color: #888; font-style: italic; }

/* Footer */
.footer {
  width: 100%;
  margin-top: 30px;
  padding: 20px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  clear: both;
}

/* ============================================================
   CLEAN PDF / PRINT LOGIC
   Everything in this block HIDES when you print
   ============================================================ */
@media print {
  /* 1. Hide the browser-added URL/Date (Note: Browser settings may override this) */
  @page {
    margin: 0.5in;
  }

  /* 2. Hide all Site UI elements */
  .topbar, 
  .dashboard-controls, 
  .home-header,
  .footer, 
  .info-icon, 
  .close-modal,
  #searchBox,
  #featureSearch {
    display: none !important;
  }

  /* 3. Strip Card styling for a clean paper look */
  .card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* 4. Professional Table for PDF */
  .feature-table {
    font-size: 12pt;
    width: 100%;
  }

  .feature-table th {
    background-color: #334466 !important;
    color: white !important;
    -webkit-print-color-adjust: exact; /* Forces background color in Chrome/Edge */
    print-color-adjust: exact;
  }
}
