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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(45deg, #b794f6, #9f7aea);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  transition: all 0.3s ease;
}

body.fullscreen {
  background: #000;
  padding: 0;
}

body.fullscreen .container {
  width: 95vw;
  height: 95vh;
  margin: 2.5vh 2.5vw;
  border-radius: 20px;
  max-width: none;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 20px;
  overflow-y: auto;
}

body.fullscreen .time-display {
  font-size: 1.2em;
  margin-bottom: 10px;
}

body.fullscreen .header-text {
  font-size: 1.1em;
  margin-bottom: 15px;
}

body.fullscreen .keypad {
  gap: 8px;
  margin-bottom: 10px;
}

body.fullscreen .key {
  min-height: 50px;
  font-size: 20px;
  padding: 15px 20px;
}

body.fullscreen .action-btn {
  min-height: 50px;
  font-size: 11px;
  padding: 15px 10px;
}

body.fullscreen .wide-btn {
  padding: 12px;
  font-size: 11px;
}

body.fullscreen .employee-grid {
  max-height: 200px;
  overflow-y: auto;
}

body.fullscreen .time-display {
  margin-bottom: 30px;
}

body.fullscreen .current-time {
  font-size: 4rem;
}

body.fullscreen .current-date {
  font-size: 1.5rem;
}

body.fullscreen .keypad {
  transform: scale(1.3);
  margin: 20px 0;
}

body.fullscreen .employee-grid {
  margin-top: 30px;
  flex: 1;
  overflow-y: auto;
}

.container {
  background: white;
  background-image: url("assets/clock_bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 25px;
  padding: 25px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  position: relative;
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 30px;
  z-index: 1;
}

.container > * {
  position: relative;
  z-index: 2;
}

.time-display {
  background: #2d3748;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
}

.current-time {
  font-size: 28px;
  font-weight: 700;
  color: white;
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.current-date {
  font-size: 14px;
  color: #a0aec0;
}

.header-text {
  font-size: 14px;
  font-weight: 400;
  color: #4a5568;
  margin-bottom: 25px;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

.pin-display {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 25px;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.pin-label {
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 10px;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.pin-label.error {
  color: #e53e3e;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

.pin-dots {
  display: flex;
  gap: 12px;
}

.pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2d3748;
  opacity: 0.3;
}

.pin-dot.filled {
  opacity: 1;
}

.pin-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 15px;
}

.key {
  padding: 20px 24px;
  font-size: 24px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #6366f1;
  color: white;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.key:hover {
  background: #5856eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.key:active {
  transform: scale(0.95);
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 15px;
}

.action-btn {
  padding: 18px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clock-in {
  background: #10b981;
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.clock-out {
  background: #ef4444;
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.clock-out:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.clock-in:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.action-btn:disabled {
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  opacity: 0.4 !important;
  filter: grayscale(0.7) !important;
}

.clock-in:disabled {
  background: #68d391 !important;
  color: #2d3748 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  opacity: 0.7 !important;
  filter: saturate(0.6) !important;
}

.clock-out:disabled {
  background: #fc8181 !important;
  color: #2d3748 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  opacity: 0.7 !important;
  filter: saturate(0.6) !important;
}

.wide-btn {
  width: 100%;
  padding: 18px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.clear-btn {
  background: #f97316;
  color: white;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.clear-btn:hover {
  background: #ea580c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.vacation-btn {
  background: #10b981;
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.vacation-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.vacation-btn:disabled {
  background: #a0aec0;
  color: #718096;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Bottom button row */
.bottom-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.bottom-btn {
  padding: 18px 8px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: white;
}

.bottom-btn.clear-btn {
  background: #f97316;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.bottom-btn.clear-btn:hover {
  background: #ea580c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.bottom-btn.vacation-btn {
  background: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.bottom-btn.vacation-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.bottom-btn.vacation-btn:disabled {
  background: #a0aec0;
  color: #718096;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.modal-content {
  background: white;
  border-radius: 15px;
  padding: 0;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin: auto;
  position: relative;
}

.modal-header {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 15px 15px 0 0;
  text-align: center;
  border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
  margin: 10px 0 0 0;
  color: #ff8c42;
  font-size: 18px;
  font-weight: 600;
}

.warning-icon,
.clock-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 10px;
}

.modal-body {
  padding: 20px;
  text-align: center;
}

.employee-name {
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 15px;
}

.shift-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  color: #4a5568;
  font-size: 14px;
}

.time-input-container {
  margin: 20px 0;
}

.time-input {
  font-size: 18px;
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
  width: 150px;
}

.modal-actions {
  padding: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-width: 120px;
}

.btn-primary {
  background: linear-gradient(135deg, #ff8c42, #ff6b35);
  color: white;
}

.btn-secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Reset PIN Modal Styles */
.employee-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin: 15px 0;
}

.employee-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid #f1f5f9;
  background: white;
}

.employee-item:last-child {
  border-bottom: none;
}

.employee-item:hover {
  background: #f8f9fa;
}

.employee-name-display {
  font-weight: 500;
  color: #2d3748;
}

.create-pin-btn {
  background: #10b981;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.create-pin-btn:hover {
  background: #059669;
}

/* PIN Creation Modal */
.pin-creation-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
  max-width: 200px;
  margin-left: auto;
  margin-right: auto;
}

.pin-key {
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  color: #2d3748;
}

.pin-key:hover {
  background: #e2e8f0;
  border-color: #cbd5e0;
}

.pin-display-input {
  font-size: 24px;
  text-align: center;
  padding: 15px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  margin: 15px 0;
  letter-spacing: 8px;
  font-family: monospace;
}

.pin-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

/* Vacation Calendar Modal Styles */
.calendar-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
  box-sizing: border-box;
}

.calendar-content {
  background: white;
  border-radius: 16px;
  padding: 20px;
  max-width: 450px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  margin: auto;
  position: relative;
}

.calendar-header h3 {
  color: #667eea;
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
}

.vacation-stats {
  margin: 15px 0;
  padding: 15px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 12px;
}

.vacation-stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
}

.vacation-stat:last-child {
  margin-bottom: 0;
}

.calendar-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
}

.month-nav {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.month-nav:hover {
  background: #5a67d8;
}

.current-month {
  font-size: 20px;
  font-weight: 600;
  color: #4a5568;
}

.legend {
  display: flex;
  justify-content: space-around;
  margin: 15px 0;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.approved {
  background: #38a169;
}

.legend-dot.pending {
  background: #3182ce;
}

.legend-dot.rejected {
  background: #ef4444;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 15px 0;
}

.calendar-day-header {
  text-align: center;
  font-weight: 600;
  color: #718096;
  padding: 10px 5px;
  font-size: 14px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  background: #f7fafc;
}

.calendar-day:hover {
  background: #e2e8f0;
  transform: scale(1.05);
}

.calendar-day.selected {
  background: linear-gradient(135deg, #f6d55c 0%, #eab308 100%);
  color: #1a202c;
  font-weight: 700;
  transform: scale(0.95);
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.4);
}

.calendar-day.pay-period-start {
  font-weight: bold;
  border: 2px solid #ffd700;
  position: relative;
}

.pay-period-star {
  font-size: 8px;
  font-weight: bold;
  color: #e53e3e;
  position: absolute;
  top: 1px;
  left: 1px;
  background: rgba(255, 255, 255, 0.8);
  padding: 1px 2px;
  border-radius: 2px;
}

.calendar-day.approved-vacation {
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
  color: white;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(56, 161, 105, 0.4);
}

.calendar-day.pending-vacation {
  background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
  color: white;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(49, 130, 206, 0.4);
}

.calendar-day.rejected-vacation {
  background: linear-gradient(135deg, #ef4444 0%, #c53030 100%);
  color: white;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.calendar-day.past-date {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.6;
  font-weight: 400;
}

.calendar-day.past-date:hover {
  background: #f1f5f9;
  transform: none;
  box-shadow: none;
}

.submit-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.submit-vacation-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.submit-vacation-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 161, 105, 0.3);
}

.submit-vacation-btn:disabled {
  background: #a0aec0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.btn-secondary {
  padding: 12px 24px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #5a67d8;
  transform: translateY(-1px);
}

.btn-warning {
  padding: 12px 24px;
  background: linear-gradient(135deg, #ff8c42, #ff6b35);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-warning:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.status-message {
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
  font-weight: 500;
  display: none;
}

.status-message.success {
  background: rgba(72, 187, 120, 0.1);
  color: #22543d;
  border: 1px solid rgba(72, 187, 120, 0.3);
}

.status-message.error {
  background: rgba(245, 101, 101, 0.1);
  color: #742a2a;
  border: 1px solid rgba(245, 101, 101, 0.3);
}

.status-message.info {
  background: rgba(107, 115, 255, 0.1);
  color: #2d3748;
  border: 1px solid rgba(107, 115, 255, 0.3);
}

.status-message.warning {
  background: rgba(255, 193, 7, 0.1);
  color: #856404;
  border: 1px solid rgba(255, 193, 7, 0.3);
  font-weight: 600;
}

.employee-grid {
  margin-top: 30px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.employee-grid h3 {
  color: #2d3748;
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
}

.employee-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.employee-table th {
  background: #f7fafc;
  color: #4a5568;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
}

.employee-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #2d3748;
}

.employee-table tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

.loading-text {
  text-align: center;
  color: #718096;
  padding: 20px;
  font-style: italic;
}

/* Ensure perfect modal centering */
.modal,
.calendar-modal {
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
}

.modal-content,
.calendar-content {
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

@media (max-width: 480px) {
  .container {
    padding: 20px;
    margin: 10px;
  }

  .key {
    padding: 15px;
    font-size: 20px;
  }

  .action-btn {
    padding: 15px 8px;
    font-size: 10px;
  }

  .employee-grid {
    margin-top: 20px;
    padding: 15px;
  }

  .employee-table {
    font-size: 11px;
  }

  .employee-table th,
  .employee-table td {
    padding: 6px 8px;
  }

  /* Mobile modal adjustments */
  .modal,
  .calendar-modal {
    padding: 10px;
  }

  .modal-content {
    max-width: 95%;
    margin: 10px;
  }

  .calendar-content {
    max-width: 95%;
    padding: 20px;
    margin: 10px;
  }

  .modal-actions {
    flex-direction: column;
    gap: 10px;
  }

  .btn {
    width: 100%;
    min-width: auto;
  }

  /* Mobile adjustments for bottom buttons */
  .bottom-buttons {
    gap: 8px;
  }

  .bottom-btn {
    padding: 12px 4px;
    font-size: 10px;
  }
}

/* Fullscreen Mode Styles - True Fullscreen - High Specificity */
body.fullscreen-mode {
  padding: 0 !important;
  margin: 0 !important;
  background: #000 !important;
}

body.fullscreen-mode .container {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-around !important;
  align-items: center !important;
  overflow: hidden !important;
  padding: 2vh 2vw !important;
  box-sizing: border-box !important;
  background: linear-gradient(45deg, #b794f6, #9f7aea) !important;
  min-height: 100vh !important;
}

@media screen and (orientation: landscape) and (min-width: 600px) and (max-width: 1024px) {
  body::before {
    content: "Please rotate your tablet to portrait mode.";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    color: #000;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
  }

  .container {
    display: none; /* hide UI in landscape */
  }
}

/* Fullscreen Mode - Override tablet styles specifically */

@media (min-width: 600px) and (max-width: 1024px) {
  body:not(.fullscreen-mode) {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }

  body:not(.fullscreen-mode) .container {
    width: 95vw;
    height: calc(90vh - 30px);
    /* account for 15px top+bottom padding */
    padding: 15px;
    box-sizing: border-box;
  }

  .pin-display {
    max-height: 130px;
    height: 100%;
    margin: 0;
  }

  .container {
    max-width: 95vw;
    width: 99% !important;
    padding: 15px;
    margin: 0 auto;
    height: 99vh !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .time-display {
    margin-bottom: 15px;
    max-height: 250px;
    height: 100%;
    display: inline-flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: center;
  }

  .current-time {
    font-size: 3rem;
  }

  .current-date,
  .pin-label {
    font-size: 1.25rem;
  }

  .pin-dot {
    width: 18px;
    height: 18px;
  }

  .keypad {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 15px 0;
    width: 100%;
    height: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .key {
    min-width: 115px;
    min-height: 65px;
    font-size: 3rem;
    max-height: 96px;
    height: 100%;
  }

  #keyZero {
    max-height: 96px;
  }

  .action-buttons {
    gap: 12px;
    margin: 0;
    max-height: 96px;
    height: 100%;
  }

  .action-btn {
    max-height: 96px;
    font-size: 1.25rem;
  }

  .bottom-buttons {
    gap: 12px;
    margin-top: 15px;
    max-height: 96px;
    height: 100%;
  }

  .bottom-btn {
    max-height: 96px;
    font-size: 1.25rem;
  }

  .status-message {
    font-size: 16px;
    margin: 15px 0;
  }
}

/* Fullscreen Mode */
body.fullscreen-mode {
  padding: 0 !important;
  margin: 0 !important;
  background: #000 !important;
}

body.fullscreen-mode .container {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  margin: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-around !important;
  align-items: center !important;
  overflow: hidden !important;
  padding: 2vh 2vw !important;
}

body.fullscreen-mode .time-display {
  margin-bottom: 3vh;
  flex-shrink: 0;
}

body.fullscreen-mode .current-time {
  font-size: clamp(4rem, 12vw, 8rem);
  line-height: 1;
  font-weight: 800;
  margin-bottom: 1vh;
}

body.fullscreen-mode .current-date {
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  margin-bottom: 3vh;
  font-weight: 600;
}

body.fullscreen-mode .pin-display {
  margin: 4vh 0;
  transform: scale(1.5);
}

body.fullscreen-mode .pin-label {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 2vh;
  font-weight: 600;
}

body.fullscreen-mode .pin-dots {
  gap: clamp(25px, 4vw, 40px);
}

body.fullscreen-mode .pin-dot {
  width: clamp(40px, 6vw, 60px);
  height: clamp(40px, 6vw, 60px);
}

body.fullscreen-mode .keypad {
  gap: clamp(30px, 4vw, 50px);
  margin: 5vh 0;
  max-width: none;
  transform: scale(1.4);
}

body.fullscreen-mode .key {
  font-size: clamp(32px, 6vw, 56px);
  width: clamp(120px, 12vw, 160px);
  height: clamp(120px, 12vw, 160px);
  border-radius: clamp(20px, 3vw, 32px);
  font-weight: 800;
}

body.fullscreen-mode .action-buttons {
  gap: clamp(30px, 4vw, 50px);
  margin: 5vh 0;
  width: 100%;
  max-width: 90vw;
  transform: scale(1.3);
}

body.fullscreen-mode .action-btn {
  font-size: clamp(24px, 4vw, 40px);
  padding: clamp(30px, 5vh, 50px) clamp(40px, 5vw, 60px);
  min-height: clamp(120px, 12vh, 160px);
  border-radius: clamp(20px, 3vw, 32px);
  font-weight: 800;
}

body.fullscreen-mode .bottom-buttons {
  gap: clamp(25px, 4vw, 45px);
  margin-top: 4vh;
  width: 100%;
  max-width: 90vw;
  transform: scale(1.2);
}

body.fullscreen-mode .bottom-btn {
  font-size: clamp(20px, 3.5vw, 32px);
  padding: clamp(25px, 4vh, 40px) clamp(30px, 4vw, 50px);
  border-radius: clamp(18px, 2.5vw, 28px);
  min-height: clamp(100px, 10vh, 130px);
  font-weight: 700;
}

/* Fullscreen responsive breakpoints */
@media (max-width: 768px) {
  body.fullscreen-mode .container {
    width: 98vw !important;
    height: 98vh !important;
    margin: 1vh auto !important;
    padding: 1vh 1vw;
  }
}

@media (min-width: 1200px) {
  body.fullscreen-mode .container {
    max-width: 1200px;
    width: 90vw !important;
  }
}

/* Global touch optimizations - ONLY for buttons, not input fields */
button,
.key,
.action-btn,
.bottom-btn {
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Ensure input fields can be selected and focused */
input,
textarea,
select {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  touch-action: auto !important;
}
