/* ===== FONTS ===== */
@font-face {
  font-family: titlefont;
  src: url(../fonts/Quicksand-Regular.ttf);
}

@font-face {
  font-family: contentlight;
  src: url(../fonts/Raleway-Light.ttf);
}

@font-face {
  font-family: countdownfont;
  src: url(../fonts/Verdana-Bold.ttf);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: contentlight, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #14213d 0%, #000000 100%);
  min-height: 100vh;
  color: #ffffff;
  line-height: 1.6;
}

header {
  background: rgba(20, 33, 61, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(252, 163, 17, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: 1rem;
}

.header-content .logo-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

header h1 {
  font-family: titlefont;
  font-size: 1.5rem;
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

main {
  flex: 1;
  padding: 1rem;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0 1rem;
}

.section {
  background: rgba(229, 229, 229, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(252, 163, 17, 0.3);
  overflow: hidden;
}

.section-title {
  font-family: titlefont;
  background: linear-gradient(135deg, #14213d, #000000);
  color: #ffffff;
  padding: 1rem;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 3px solid #fca311;
}

.section-title .icon {
  font-size: 1.5rem;
}

.content-list {
  padding: 1rem;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: #14213d;
  font-style: italic;
}

.list-item {
  background: #ffffff;
  border: 1px solid rgba(20, 33, 61, 0.2);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: #14213d;
}

.list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(252, 163, 17, 0.3);
  border-color: #fca311;
}

.list-item:last-child {
  margin-bottom: 0;
}

.lunch-item {
  text-align: center;
}

.lunch-item .meal-name {
  font-family: titlefont;
  font-size: 1.1rem;
  font-weight: 600;
  color: #14213d;
  margin-bottom: 0.5rem;
}

.lunch-item .meal-description {
  color: #000000;
  font-size: 0.95rem;
}

.today-menu {
  margin-bottom: 1.5rem;
}

.today-title {
  font-family: titlefont;
  color: #ffffff;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
  background: linear-gradient(45deg, #fca311, #14213d);
  padding: 0.75rem;
  border-radius: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.today-lunch {
  border-left: 4px solid #fca311;
  background: rgba(252, 163, 17, 0.1);
}

.other-menus {
  margin-top: 1rem;
}

.other-title {
  font-family: titlefont;
  color: #14213d;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.menu-day {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(229, 229, 229, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(20, 33, 61, 0.1);
}

.menu-date {
  font-family: countdownfont;
  color: #ffffff;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  text-align: center;
  background: #14213d;
  padding: 0.5rem;
  border-radius: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-menus {
  width: 100%;
  background: linear-gradient(45deg, #fca311, #14213d);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 8px;
  font-family: titlefont;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-menus:hover {
  background: linear-gradient(45deg, #14213d, #000000);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(252, 163, 17, 0.3);
}

.toggle-menus.expanded .toggle-icon {
  transform: rotate(180deg);
}

.toggle-icon {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
}

.collapsible-menus {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.collapsible-menus.expanded {
  max-height: none;
  padding-top: 1rem;
}

.substitution-item {
  border-left: 4px solid #fca311;
}

.substitution-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.class-period {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.class-info-mobile, .period-info-mobile, .room-info-mobile {
  background: #14213d;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.period-info-mobile {
  background: #fca311;
  color: #ffffff;
}

.room-info-mobile {
  background: #000000;
  color: #ffffff;
}

.subject-mobile {
  font-family: titlefont;
  font-size: 1rem;
  font-weight: 600;
  color: #14213d;
  margin-bottom: 0.5rem;
}

.teacher-change-mobile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.teacher-mobile {
  background: rgba(229, 229, 229, 0.7);
  padding: 0.5rem;
  border-radius: 8px;
  text-align: center;
  flex: 1;
  min-width: 120px;
  border: 1px solid rgba(20, 33, 61, 0.1);
}

.teacher-label {
  font-size: 0.8rem;
  color: #14213d;
  margin-bottom: 0.25rem;
}

.teacher-name {
  font-weight: 600;
  color: #000000;
}

.arrow-mobile {
  color: #fca311;
  font-size: 1.2rem;
  font-weight: bold;
}

.change-type-mobile {
  font-family: titlefont;
  font-size: 0.9rem;
  color: #ffffff;
  font-weight: 600;
  text-align: center;
  margin: 0.5rem 0;
  padding: 0.25rem 0.5rem;
  background: rgba(209, 136, 0, 0.7);
  border-radius: 6px;
  border: 1px solid rgba(192, 106, 0, 0.8);
  box-shadow: 0 2px 8px rgba(209, 136, 0, 0.3);
}

.room-change-mobile {
  text-align: center;
  padding: 0.5rem;
}

.change-info {
  font-size: 0.9rem;
  color: #14213d;
  font-weight: 500;
  background: rgba(229, 229, 229, 0.7);
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(20, 33, 61, 0.1);
}

.cancellation-notice-mobile {
  text-align: center;
  padding: 0.5rem;
}

.cancellation-info-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-radius: 8px;
  padding: 0.5rem;
}

.cancellation-icon-mobile {
  font-size: 1.2rem;
}

.cancellation-text-mobile {
  font-family: titlefont;
  font-size: 0.9rem;
  color: #dc3545;
  font-weight: 600;
}

.program-item {
  border-left: 4px solid #fca311;
}

.program-date {
  font-family: countdownfont;
  font-size: 0.9rem;
  color: #fca311;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.program-title {
  font-family: titlefont;
  font-size: 1.1rem;
  font-weight: 600;
  color: #14213d;
  margin-bottom: 0.5rem;
}

.program-description {
  color: #000000;
  font-size: 0.95rem;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #14213d;
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state .message {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #14213d;
}

.empty-state .submessage {
  font-size: 0.9rem;
  opacity: 0.8;
  color: #000000;
}

footer {
  background: rgba(20, 33, 61, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(252, 163, 17, 0.3);
  padding: 1rem;
  margin-top: 2rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  color: #e5e5e5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.footer-content p {
  margin: 0;
}

#countdown-container {
    display: none; 
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(252, 163, 17, 0.3);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

#countdown-container:hover {
    background: rgba(252, 163, 17, 0.2);
    border-color: rgba(252, 163, 17, 0.6);
    transform: scale(1.05);
}

#countdown-timer {
    font-family: countdownfont;
    font-size: 1.8rem;
    color: #fca311;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: color 0.3s ease;
    font-weight: 900;
}

#countdown-timer.urgent {
    color: #ff4444 !important;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { opacity: 1; }
    to { opacity: 0.7; }
}

#countdown-label {
    font-family: contentfont;
    font-size: 0.7rem;
    color: #e5e5e5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 4px;
    font-weight: 500;
}

#clock-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(252, 163, 17, 0.2);
}

#current-time {
    color: #fca311;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-family: countdownfont;
    font-size: 1.1rem;
    font-weight: 500;
}

.ring-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 80%;
    background: rgba(252, 163, 17, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    border: 2px solid rgba(20, 33, 61, 0.8);
    font-family: titlefont;
    font-size: 2.5vh;
    font-weight: 100;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    white-space: nowrap;
}

.notification-text {
    flex: 1;
    line-height: 1.4;
}

.notification-text strong {
    font-weight: bold;
}


@media (min-width: 768px) and (max-width: 1023px) {
  .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
  }
  
  #lunch-section {
    grid-column: 1 / -1;
  }
  
  #substitution-section {
    grid-column: 1;
  }
  
  #programs-section {
    grid-column: 2;
  }
  
  header h1 {
    font-size: 1.8rem;
  }
  
  .section-title {
    font-size: 1.4rem;
  }
  
  .teacher-change-mobile {
    justify-content: flex-start;
  }
}

@media (min-width: 1024px) {
  .container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    max-width: 100%;
    align-items: start;
  }
  
  #lunch-section {
    grid-column: 1;
  }
  
  #substitution-section {
    grid-column: 2;
  }
  
  #programs-section {
    grid-column: 3;
  }
  
  .header-content {
    padding: 1.5rem;
  }
  
  .logo {
    width: 50px;
    height: 50px;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  main {
    padding: 2rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  #substitution-content {
    display: block;
  }
  
  .substitution-item {
    margin-bottom: 0.75rem;
  }
}

@media (min-width: 1200px) {
  .container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2.5rem;
    max-width: 100%;
    align-items: start;
  }
  
  #lunch-section {
    grid-column: 1;
  }
  
  #substitution-section {
    grid-column: 2;
  }
  
  #programs-section {
    grid-column: 3;
  }
  
  .section-title {
    font-size: 1.4rem;
  }
  
  #substitution-content {
    display: block;
  }
  
  .substitution-item {
    margin-bottom: 1rem;
  }
  
  #programs-content {
    display: block;
  }
  
  .program-item {
    margin-bottom: 1rem;
  }
}

@media (min-width: 1600px) {
  .container {
    max-width: 100%;
    margin: 0 auto;
    gap: 3rem;
  }
  
  main {
    padding: 2rem 3rem;
  }
  
  .section-title {
    font-size: 1.6rem;
  }
}

@media (min-width: 2560px) {
  .container {
    max-width: 100%;
    gap: 4rem;
  }
  
  main {
    padding: 3rem 4rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .substitution-item, .lunch-item, .program-item {
    padding: 1.5rem;
  }
  
  .class-period {
    gap: 1rem;
  }
  
  .class-info-mobile, .period-info-mobile, .room-info-mobile {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }

  .header-content {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  #countdown-container {
    margin-top: 0.5rem;
  }

  #countdown-timer {
    font-size: 1.4rem;
  }

  #countdown-label {
    font-size: 0.6rem;
  }

  .footer-content {
    gap: 0.6rem;
  }

  #clock-container {
    padding: 0.4rem 0.8rem;
  }

  #current-time {
    font-size: 1rem;
  }
}

.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #14213d 0%, #000000 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.fullscreen-content {
    text-align: center;
    color: white;
    position: relative;
    width: 90%;
    max-width: 800px;
}

.fullscreen-label {
    font-family: titlefont;
    font-size: 8vh;
    color: #fca311;
    margin-bottom: 4vh;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
    animation: slideInFromTop 0.5s ease-out;
}

.fullscreen-timer {
    font-family: countdownfont;
    font-size: 20vh;
    color: #ffffff;
    text-shadow: 0 8px 16px rgba(0, 0, 0, 0.8);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.fullscreen-timer.critical {
    color: #ff0000 !important;
    text-shadow: 0 8px 16px rgba(255, 0, 0, 0.8) !important;
    animation: slideInFromBottom 0.5s ease-out, criticalBlink 0.5s ease-in-out infinite !important;
}

.close-button {
    position: absolute;
    top: -10vh;
    right: -5vw;
    font-size: 8vh;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.close-button:hover {
    color: #fca311;
    transform: scale(1.2);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInFromTop {
    from { 
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes countdownPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes criticalBlink {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

@media (max-width: 768px) {
    .fullscreen-label {
        font-size: 6vh;
        margin-bottom: 3vh;
    }
    
    .fullscreen-timer {
        font-size: 15vh;
    }
    
    .close-button {
        font-size: 6vh;
        top: -8vh;
        right: -3vw;
    }
}

@media (max-width: 480px) {
    .fullscreen-label {
        font-size: 4vh;
        margin-bottom: 2vh;
    }
    
    .fullscreen-timer {
        font-size: 12vh;
    }
    
    .close-button {
        font-size: 5vh;
        top: -6vh;
        right: -2vw;
    }
}

/* ===== Image Popup ===== */
#image-popup .image-popup-content {
  position: relative;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#image-popup img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  border: 1px solid rgba(252, 163, 17, 0.4);
}

#image-popup .image-close-button {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 6vh;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  user-select: none;
}

#image-popup .image-close-button:hover {
  color: #fca311;
}
