/* === HEADER === */
.app-header {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
  color: var(--white);
  padding: var(--space-lg);
  text-align: center;
}

.app-title {
  font-size: var(--font-size-xxl);
  font-weight: bold;
}

/* === PROGRESS CIRCLE === */
.progress-section {
  padding: var(--space-xl);
  text-align: center;
}

.progress-circle {
  position: relative;
  width: 250px;
  height: 250px;
  margin: 0 auto var(--space-lg);
}

.circle-background {
  width: 100%;
  height: 100%;
  border: 3px solid var(--medium-gray);
  border-radius: var(--radius-full);
  position: absolute;
  background: var(--white);
  overflow: hidden;
}

.circle-rotation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top: 3px solid var(--primary-blue);
  border-right: 3px solid var(--primary-blue);
  border-radius: var(--radius-full);
  transform: rotate(45deg);
  animation: rotateContinuous 20s linear infinite;
  z-index: 2;
}

.water-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  transform: rotate(-90deg);
  transition: height 1s ease;
  transition: width 1s ease;
  z-index: 1;
}

.water-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(to top, var(--primary-blue), var(--light-blue));
  transition: height 1s ease;
  transition: width 1s ease;
}

.circle-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 3;
  background: var(--white);
  width: 180px;
  height: 180px;
  border-radius: var(--radius-full);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.consumed-amount {
  color: var(--primary-blue);
  font-size: var(--font-size-xxl);
  font-weight: bold;
  display: block;
  margin-bottom: var(--space-xs);
}

.remaining-amount {
  color: var(--dark-gray);
  font-size: var(--font-size-sm);
  display: block;
}

/* Animation de rotation continue */
@keyframes rotateContinuous {
  0% {
    transform: rotate(45deg);
  }
  100% {
    transform: rotate(405deg);
  }
}

/* Animation de vague */
@keyframes waveRipple {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

/* Animation de pulsation pour objetif atteint */
@keyframes pulseSuccess {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15 rgba(46, 204, 113, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  }
}

/* === BOUTONS AND QUICK ADD SECTION === */
.quick-add-section {
  padding: 0 var(--space-lg) var(--space-lg);
}

.quick-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.water-btn {
  background: var(--primary-blue);
  color: var(--white);
  border: none;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
  min-width: 80px;
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.water-btn:hover {
  background: var(--dark-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(52, 152, 219, 0.4);
}

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

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border: none;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  cursor: pointer;
}

/* === NAVIGATION === */
.bottom-nav {
  background: var(--white);
  border-top: 1px solid var(--medium-gray);
  display: flex;
  justify-content: space-around;
  padding: var(--space-sm);
}

.nav-item {
  color: var(--dark-gray);
  text-decoration: none;
  text-align: center;
  padding: var(--space-sm);
}

.nav-item.active {
  color: var(--primary-blue);
}

/* === PARAMÈTRES === */
.setting-item {
  background: var(--white);
  border: 1px solid var(--medium-gray);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 2;
  cursor: pointer;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--medium-gray);
  transition: .4s;
  border-radius: 24px;
  z-index: 1;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: var(--white);
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-blue);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* === HISTORIQUES & GRAPHIQUES === */
.tabs {
  display: flex;
  background: var(--medium-gray);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: var(--space-lg);
}

.tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.tab.active {
  background: var(--white);
  box-shadow: var(--shadow);
}

.chart-container {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow);
}

.chart-bars {
  display: flex;
  align-items: end;
  justify-content: space-around;
  height: 200px;
  gap: var(--space-md);
}

.chart-bar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
}

.chart-bar {
  background: linear-gradient(to top, var(--primary-blue), var(--light-blue));
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  width: 100%;
  min-height: 20px;
  transition: height 0.5s ease;
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
}

.chart-value {
  color: var(--white);
  font-size: var(--font-size-sm);
  font-weight: bold;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px  rgba(0, 0, 0, 0.3);
}

.chart-label {
  margin-top: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--dark-gray);
  font-weight: 500;
}

.history-list {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}

.history-list h3 {
  color: var(--primary-blue);
  margin-bottom: var(--space-md);
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.entry-item {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: var(--space-sm);
   background: var(--light-gray);
   border-radius: var(--radius-sm);
   transition: background 0.3s ease;
}

.entry-item:hover {
  background: var(--medium-gray);
}

.entry-time {
  color: var(--dark-gray);
  font-weight: 500;
}

.entry-amount {
  color: var(--primary-blue);
  font-weight: bold;
}

.empty-state {
  text-align: center;
  padding: var(--space-xl);
  color: var(--gray);
}

.hidden {
  display: none !important;
}

/* === PARAMÈTRES === */
.settings-section {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow);
}

.settings-section h3 {
    color: var(--primary-blue);
    margin-bottom: var(--space-md);
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: var(--space-sm);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--light-gray);
}

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

.setting-item label {
    font-weight: 500;
    color: var(--text);
}

.setting-select {
    padding: 8px 12px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    min-width: 150px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    color: var(--primary-blue);
    margin-bottom: var(--space-md);
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-lg);
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animation de confirmation */
@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.9);
  }
}

/* Responsive */
@media (max-width: 480px) {
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .setting-select {
        width: 100%;
    }

    .modal-actions {
        flex-direction: column;
    }
}

/* === ANIMATIONS MESSAGES DE MOTIVATION === */
@keyframes slideUpMotivation {
    0% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(30px) scale(0.9);
    }
    15% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0) scale(1);
    }
    85% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-30px) scale(0.9);
    }
}

@keyframes celebrateMessage {
    0% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(30px) scale(0.8);
    }
    15% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0) scale(1.1);
    }
    25% { 
        transform: translateX(-50%) translateY(0) scale(1);
    }
    85% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-30px) scale(0.9);
    }
}

/* Responsive pour les messages */
@media (max-width: 480px) {
    .motivation-message {
        bottom: 80px !important;
        padding: 10px 20px !important;
        font-size: 0.9rem;
        max-width: 90%;
    }
}

@media (min-width: 769px) {
    .motivation-message {
        bottom: 120px !important;
        font-size: 1rem;
    }
}