* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Thai', system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
    overflow: auto;
}


/* Top Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin-bottom: 5rem;
    position: fixed;
    z-index: 1000;
}

.nav-left {
    display: flex;
    gap: 30px;
}

.nav-item {
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.nav-item:hover::before {
    left: 100%;
}

.nav-item:hover {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-item.active {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
}

.logout {
    color: #ef4444;
    text-decoration: none;
    font-weight: bold;
    padding: 12px 24px;
    border: 2px solid #ef4444;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.logout::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #ef4444;
    transition: left 0.3s ease;
    z-index: -1;
}

.logout:hover::before {
    left: 0;
}

.logout:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 5px;
        padding: 5px;
    }

    .nav-left {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .nav-item {
        color: #1e293b;
        text-decoration: none;
        font-weight: 600;
        padding: 2px 8px;
        border-radius: 12px;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .nav-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
        transition: left 0.5s;
    }

    .nav-item:hover::before {
        left: 100%;
    }

    .nav-item:hover {
        background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .nav-item.active {
        background: linear-gradient(135deg, #fbbf24, #f59e0b);
        color: #1e293b;
        font-weight: 700;
        box-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
    }

    .logout {
        color: #ef4444;
        text-decoration: none;
        font-weight: 700;
        padding: 4px 10px;
        border: 2px solid #ef4444;
        border-radius: 12px;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .logout::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: #ef4444;
        transition: left 0.3s ease;
        z-index: -1;
    }

    .logout:hover::before {
        left: 0;
    }

    .logout:hover {
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
    }
}

/* iPhone XR and similar mobile devices */
@media (max-width: 480px) {
    .navbar {
        padding: 8px 12px;
        margin-bottom: 3rem;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .nav-left {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        flex: 1;
        justify-content: center;
    }

    .nav-item {
        font-size: 11px;
        padding: 6px 8px;
        border-radius: 6px;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    .logout {
        font-size: 11px;
        padding: 6px 12px;
        border-radius: 6px;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    /* Reduce animations for better performance on mobile */
    .nav-item::before,
    .logout::before {
        display: none;
    }

    .nav-item:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .logout:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    }
}

/* Extra small mobile devices */
@media (max-width: 375px) {
    .navbar {
        padding: 6px 8px;
        margin-bottom: 2.5rem;
    }

    .nav-item {
        font-size: 10px;
        padding: 4px 6px;
        min-height: 28px;
    }

    .logout {
        font-size: 10px;
        padding: 4px 8px;
        min-height: 28px;
    }
}

/* Glassmorphism Modal Overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: linear-gradient(135deg, rgba(135, 206, 235, 0.4), rgba(255, 182, 193, 0.4));
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Glassmorphic Modal Content */
.modal-content {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 248, 255, 0.9));
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 2px solid rgba(173, 216, 230, 0.8);
  border-radius: 28px;
  padding: 32px;
  max-width: 900px;
  margin: auto;
  width: 90%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(135, 206, 235, 0.3);
  display: flex;
  flex-direction: column;
  position: relative;
  animation: modalSlideIn 0.4s ease-out;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modal-content:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.25), 0 0 30px rgba(255, 182, 193, 0.4);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Glassmorphic Close Button */
.close {
  color: rgba(0, 0, 0, 0.7);
  align-self: flex-end;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(173, 216, 230, 0.5));
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(135, 206, 235, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.close:hover,
.close:focus {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(255, 20, 147, 0.8), rgba(255, 105, 180, 0.8));
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 20, 147, 0.5);
}

/* Modal Inner Content */
.modal-inner-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 32px 24px;
  font-size: 1.25rem;
  color: rgba(0, 0, 0, 0.9);
}

/* Button Container */
.modalButtonHolder {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

/* Glassmorphic Pill Buttons */
.btn-quarter {
  flex: 1;
  max-width: 200px;
  padding: 16px 32px;
  font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  font-size: 1.05rem;
  font-weight: 600;
  border: 2px solid rgba(135, 206, 235, 0.8);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(240, 248, 255, 0.7));
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.btn-quarter:hover {
  background: linear-gradient(135deg, rgba(173, 216, 230, 0.8), rgba(135, 206, 235, 0.8));
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 15px rgba(135, 206, 235, 0.4);
  color: rgba(0, 0, 0, 0.9);
}

.btn-quarter:active {
  transform: translateY(0) scale(1);
}

/* Red Confirm Button */
.btn-red {
  background: linear-gradient(135deg, rgba(255, 99, 71, 0.2), rgba(255, 69, 0, 0.2));
  color: #ff4500;
  border: 2px solid rgba(255, 69, 0, 0.5);
}

.btn-red:hover {
  background: linear-gradient(135deg, rgba(255, 99, 71, 0.4), rgba(255, 69, 0, 0.4));
  border-color: rgba(255, 69, 0, 0.7);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 69, 0, 0.3), 0 0 15px rgba(255, 99, 71, 0.4);
}

/* Responsive Design for Mobile */
@media screen and (max-width: 768px) {
  .modal {
    padding: 16px;
  }

  .modal-content {
    width: 90%;
    padding: 24px 20px;
    border-radius: 24px;
  }

  .modal-inner-content {
    padding: 24px 16px;
    font-size: 1.1rem;
  }

  .modalButtonHolder {
    flex-direction: column;
    gap: 12px;
  }

  .btn-quarter {
    max-width: 100%;
    width: 100%;
  }

  .close {
    font-size: 28px;
    width: 36px;
    height: 36px;
  }
}

@media screen and (max-width: 480px) {
  .modal-content {
    width: 90%;
    padding: 20px 16px;
  }

  .modal-inner-content {
    font-size: 1rem;
    padding: 20px 12px;
  }

  .btn-quarter {
    padding: 14px 24px;
    font-size: 1rem;
  }
}