* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  padding: 25px;
  line-height: 1.2;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  color: white;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  margin-bottom: 50px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
  font-weight: 500;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.07);
  border: 1px solid rgba(255,255,255,0.5);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.panel h2 {
  color: #667eea;
  margin-bottom: 8px;
  font-size: clamp(0.85rem, 2vw, 1rem);
  text-align: center;
  font-weight: 400;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  flex-grow: 1;
}

.days-panel .input-group {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 5px;
}

input[type="date"] {
  padding: 6px 8px;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  background: white;
  transition: all 0.2s ease;
}

input[type="date"]:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.08);
}

button {
  padding: 7px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.1px;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.days-panel .input-group input {
  flex: 1;
  min-width: 120px;
}

.result {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
  border-radius: 8px;
  padding: 10px;
  border-left: 3px solid #667eea;
  margin-top: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.result.show {
  opacity: 1;
  transform: translateY(0);
}

.result div {
  font-size: clamp(0.85rem, 1.9vw, 0.95rem);
  margin-bottom: 3px;
  font-weight: 400;
}

.result span {
  color: #764ba2;
  font-weight: 600;
  font-size: clamp(1rem, 2.8vw, 1.2rem);
}

/* MOBILE */
@media (max-width: 768px) {
  body { padding: 15px; }
  .calculator-grid { grid-template-columns: 1fr; gap: 25px; }
  .days-panel .input-group { flex-direction: column; }
}

@media (max-width: 400px) {
  .panel { padding: 10px; }
}

/* BEAUTIFUL POPUP SYSTEM */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.popup {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 15px 40px rgba(0,0,0,0.2);
  min-width: 260px;
  max-width: 90vw;
  overflow: hidden;
  margin: 20px;
}

.popup-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.popup-header h3 {
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
  text-align: center;
}

.popup-actions {
  padding: 12px 16px;
  text-align: center;
}

.popup-btn {
  padding: 7px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.popup-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
