:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #7209b7;
  --accent: #f72585;
  --light: #f8f9fa;
  --dark: #212529;
  --success: #4cc9f0;
  --danger: #ef233c;
  --gray: #adb5bd;
  --border-radius: 16px;
  --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: var(--dark);
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 500px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.header {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  color: white;
  padding: 15px;
  text-align: center;
  position: relative;
}

.header h1 {
  font-size: 1.8rem;
  font-weight: 600;
}

.header p {
  font-size: 0.9rem;
  opacity: 0.9;
  max-width: 80%;
  margin: 0 auto;
}

.content {
  padding: 20px;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark);
  font-size: 0.95rem;
}

.input-group {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 1.1rem;
}

input[type="date"] {
  width: 100%;
  padding: 14px 14px 14px 45px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
  color: var(--dark);
  background: #f8f9fa;
}

input[type="date"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
  background: white;
}

.btn {
  display: block;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(to right, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(67, 97, 238, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.result-container {
  text-align: center;
  padding: 20px;
  border-radius: 12px;
  background: #f8f9fa;
  margin: 25px 0;
  border: 2px dashed #e9ecef;
  transition: var(--transition);
}

.result-container.has-result {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: var(--success);
}

#result {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-dark);
  min-height: 2.2rem;
}

.section-title {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f1f3f5;
  color: var(--dark);
}

.section-title i {
  margin-right: 10px;
  color: var(--primary);
  background: #eef2ff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#history-list {
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 10px;

  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--primary) #f1f1f1;
}

/* Chrome, Edge e Opera */
#history-list::-webkit-scrollbar {
  width: 8px;
}

#history-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#history-list::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.history-item {
  background: white;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

.history-item:hover {
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.history-dates {
  flex: 1;
  font-size: 0.95rem;
}

.history-days {
  background: var(--primary);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 10px;
}

.delete-btn {
  background: #fff0f0;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--danger);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-btn:hover {
  background: var(--danger);
  color: white;
}

#clear-history {
  margin-top: 15px;
  background: #fff5f5;
  color: var(--danger);
  border: 1px solid #ffe3e3;
  font-weight: 600;
  padding: 12px;
}

#clear-history:hover {
  background: var(--danger);
  color: white;
}

.empty-history {
  text-align: center;
  padding: 20px;
  color: var(--gray);
  font-style: italic;
}

.footer {
  text-align: center;
  padding: 15px;
  color: var(--gray);
  font-size: 0.85rem;
  border-top: 1px solid #f1f3f5;
}

@media (max-width: 480px) {
  .header {
    padding: 20px 15px;
  }

  .content {
    padding: 20px 15px;
  }

  .card {
    padding: 20px;
  }

  input[type="date"] {
    padding: 12px 12px 12px 40px;
  }

  .btn {
    padding: 14px;
  }
}
