/* ===========================================
   modals.css — All modal overlays:
   base modal, photobook, experience/education grid,
   and room detail / project accordion.
   =========================================== */

/* --- Base Modal --- */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #1a1a2e;
  border: 6px solid #fff;
  padding: 40px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 40px rgba(255, 165, 0, 0.5);
  box-sizing: border-box;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: "Press Start 2P", cursive;
  font-size: 24px;
  background: #e94560;
  color: #fff;
  border: 3px solid #fff;
  width: 50px;
  height: 50px;
  cursor: pointer;
  transition: all 0.1s;
  z-index: 2001;
}

.close-btn:hover {
  background: #ff6b6b;
}

/* --- Photobook Modal --- */

#photobook-modal {
  background: rgba(0, 0, 0, 0.35);
}

#photobook-modal .photobook-close {
  position: fixed;
  top: 20px;
  right: 20px;
}

.photobook-spread {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 100vh;
  width: 100%;
}

.photobook-page {
  width: 450px;
  height: 700px;
  background: #2c2c2c;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.photobook-page.left-page {
  border: 12px solid #8b4513;
  border-right: 6px solid #8b4513;
}

.photobook-page.right-page {
  border: 12px solid #8b4513;
  border-left: 6px solid #8b4513;
}

.photobook-spine {
  width: 8px;
  height: 700px;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
}

.photo-frame {
  width: 100%;
  height: 50%;
  background: #e8e8e8;
  padding: 5px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.portfolio-photo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: auto;
}

.photo-caption {
  display: none;
}

/* Page navigation arrows (left / right of photobook) */
.page-nav-side {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Press Start 2P", cursive;
  font-size: 20px;
  padding: 40px 15px;
  background: rgba(74, 144, 226, 0.8);
  color: #fff;
  border: 3px solid #fff;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2001;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.page-nav-side.prev-page {
  left: 20px;
}

.page-nav-side.next-page {
  right: 20px;
}

.page-nav-side:hover {
  background: rgba(91, 163, 255, 0.9);
  transform: translateY(-50%) scale(1.05);
}

.page-nav-side:disabled {
  background: rgba(102, 102, 102, 0.5);
  cursor: not-allowed;
  opacity: 0.5;
}

.page-counter {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 12px;
  color: #ffa500;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border: 2px solid #ffa500;
  z-index: 2001;
}

/* --- Experience Modal --- */

#experience-modal {
  background: rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

#experience-modal .experience-close {
  position: fixed;
  top: 20px;
  right: 20px;
}

.experience-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
}

.experience-title {
  font-family: "Press Start 2P", cursive;
  font-size: 24px;
  color: #4caf50;
  text-align: center;
  margin-bottom: 40px;
  text-shadow: 3px 3px 0 #000;
}

/* --- Education Grid (inside experience modal) --- */

.education-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 30px;
  max-width: 1000px;
  width: 100%;
}

/* Shared card base */
.uni-room {
  background: rgba(211, 47, 47, 0.9);
  border: 4px solid #fff;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.uni-room:hover {
  background: rgba(255, 82, 82, 0.9);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.5);
}

.uni-room h3 {
  font-size: 12px;
  color: #ffeb3b;
  text-align: center;
  margin-bottom: 15px;
  text-shadow: 2px 2px 0 #000;
}

.uni-room .room-content {
  font-size: 8px;
  color: #fff;
  line-height: 1.6;
  text-align: center;
}

/* Colour variants per education type */
.edu-bsc {
  background: rgba(211, 47, 47, 0.9) !important;
}
.edu-bsc:hover {
  background: rgba(255, 82, 82, 0.9) !important;
}
.edu-bsc h3 {
  color: #ffeb3b !important;
}

.edu-msc-container {
  background: rgba(30, 60, 114, 0.95);
  border: 4px solid #fff;
  padding: 20px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
  grid-row: span 2;
  box-sizing: border-box;
}

.msc-title {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #ffeb3b;
  text-align: center;
  margin-bottom: 15px;
  text-shadow: 2px 2px 0 #000;
}

.msc-description {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #fff;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 20px;
}

.msc-modules {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.edu-msc {
  background: rgba(25, 118, 210, 0.9) !important;
  padding: 8px 12px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.edu-msc h3 {
  margin: 0;
  text-align: center;
  font-size: 10px;
}
.edu-msc:hover {
  background: rgba(66, 165, 245, 0.9) !important;
}

.edu-internship {
  background: rgba(46, 125, 50, 0.9) !important;
}
.edu-internship:hover {
  background: rgba(76, 175, 80, 0.9) !important;
}
.edu-internship h3 {
  color: #ff8c00 !important;
}

.edu-certificate {
  grid-column: span 2;
  background: rgba(106, 27, 154, 0.9) !important;
}
.edu-certificate:hover {
  background: rgba(142, 36, 170, 0.9) !important;
}
.edu-certificate h3 {
  color: #ff8c00 !important;
}

/* Legacy university grid (kept for compatibility) */
.university-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  max-width: 900px;
  width: 100%;
}

/* Mobile-only summary shown instead of full room-content */
.room-summary,
.msc-description-mobile {
  display: none;
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #fff;
  text-align: center;
  line-height: 1.6;
}

/* --- Room Detail Modal (project accordion) --- */

.room-detail h2 {
  font-size: 18px;
  color: #ffa500;
  text-align: center;
  margin-bottom: 30px;
  text-shadow: 3px 3px 0 #000;
}

.room-projects {
  display: grid;
  gap: 20px;
}

.project-item {
  background: rgba(74, 144, 226, 0.2);
  border: 3px solid #4a90e2;
  padding: 15px 20px;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.project-item:hover {
  background: rgba(74, 144, 226, 0.35);
}

.project-item h3 {
  font-size: 12px;
  color: #ffeb3b;
  margin-bottom: 0;
  position: relative;
  padding-right: 25px;
}

/* Expand/collapse arrow */
.project-item h3::after {
  content: "\25BC";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  font-size: 8px;
  transition: transform 0.2s ease;
}

.project-item.expanded h3::after {
  transform: translateY(-50%) rotate(0deg);
}

.project-description {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    margin-top 0.3s ease;
  margin-top: 0;
}

.project-item.expanded .project-description {
  max-height: 500px;
  margin-top: 15px;
}

.project-item.expanded h3 {
  margin-bottom: 0;
}

/* Single-item rooms stay expanded without accordion chrome */
.project-item.no-accordion {
  cursor: default;
}
.project-item.no-accordion:hover {
  background: rgba(74, 144, 226, 0.2);
}
.project-item.no-accordion h3 {
  padding-right: 0;
}
.project-item.no-accordion h3::after {
  display: none;
}

.project-item p {
  font-size: 9px;
  color: #fff;
  line-height: 1.6;
}

.project-item a {
  color: #40e0d0;
  text-decoration: none;
}

.project-item a:hover {
  color: #7fffd4;
  text-decoration: underline;
}
