/* ===== BASE STYLES ===== */
:root {
  --primary-blue: #000091;
  --primary-red: #E1000F;
  --white: #ffffff;
  --light-gray: #f5f5f7;
  --transition: 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--white);
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

/* ===== LAYOUT ===== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.working-frame {
  padding: 20px;
  flex: 1;
}

/* ===== BANNER ===== */
.banner img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: transform var(--transition);
}

.banner img:active {
  transform: scale(0.98);
}

/* ===== HEADER ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

header h1 {
  color: var(--primary-blue);
  font-size: 1.5rem;
  font-weight: 600;
}

/* ===== MENU SYSTEM ===== */
.menu-toggle {
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  position: relative;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--primary-blue);
  position: absolute;
  left: 0;
  transition: all var(--transition);
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-toggle span:nth-child(3) { bottom: 0; }

.menu-toggle.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

.menu-overlay {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: var(--white);
  transition: right var(--transition);
  z-index: 1000;
  padding: 80px 20px 20px;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  overflow-y: auto;
}

.menu-overlay.active {
  right: 0;
}

.menu-nav > ul > li {
    position: relative;
}

/* Hover effects */
.menu-nav a:hover {
    color: var(--primary-red); /* Slight color change on hover */
}

/* Active page indicator */
.menu-nav a.active-page {
    font-weight: 600;
    color: var(--primary-red);
}

.has-submenu > a {
    padding-right: initial; /* Remove if you added this previously */
}

.has-submenu > a::after {
    content: " ▼";
    font-size: 0.7em;
    margin-left: 5px;
    display: inline-block;
    transition: transform 0.2s;
    color: inherit; /* Match text color */
}

.has-submenu.active > a::after {
    transform: translateY(-50%) rotate(180deg);
}

.submenu {
    display: none;
    padding-left: 15px;
}

.has-submenu.active > .submenu {
    display: block;
}

/* Ensure menu stays on top */
.menu-overlay {
    z-index: 1000;
}

/* Make sure links are clickable */
.menu-nav a {
    pointer-events: auto;
    color: var(--primary-blue);
    text-decoration: none; /* Remove underline */
    display: block;
    padding: 12px 0; /* Restore original padding */
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.2s;
}

.menu-nav ul {
  list-style: none;
}



/* ===== CONTENT AREA ===== */
.text-content {
  background-color: var(--light-gray);
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
}

.section {
  margin-bottom: 25px;
}

.section-title {
  color: var(--primary-red);
  font-size: 1.2rem;
  margin-bottom: 10px;
  font-weight: 500;
}

/* ===== BUTTONS ===== */
.button-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-top: 20px;
}

.btn {
  background-color: var(--primary-blue);
  color: white;
  border: none;
  padding: 12px 15px;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition);
}

.btn:hover {
  background-color: #0000b4;
}

/* ===== CALENDAR ===== */
.calendar-container {
  width: 100%;
  height: 600px;
  margin-top: 20px;
}

.calendar-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}

/* ===== LOADING STATES ===== */
#content[aria-busy="true"] {
  position: relative;
  min-height: 100px;
}

#content[aria-busy="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 3px solid var(--primary-blue);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (min-width: 768px) {
  .button-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive content styles */
.text-content {
    overflow-wrap: break-word;
}

.text-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 8px;
}

.text-content p,
.text-content ul,
.text-content ol {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.text-content h1,
.text-content h2,
.text-content h3,
.text-content h4 {
    margin: 1.5rem 0 1rem;
    color: var(--primary-blue);
}

.text-content a {
    color: var(--primary-blue);
    text-decoration: underline;
}

/* Responsive tables */
.text-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    overflow-x: auto;
    display: block;
}

.text-content th,
.text-content td {
    padding: 0.5rem;
    border: 1px solid #ddd;
}

/* Responsive iframes (for embedded content) */
.text-content iframe {
    max-width: 100%;
}

/* Small screens adjustments */
@media (max-width: 480px) {
    .text-content {
        padding: 10px;
    }
    
    .text-content img {
        margin: 0.5rem auto;
    }
}
