/* ===================================
   WATER TRACKER STYLES
   =================================== */

.water-section {
    padding: var(--spacing-2xl) 0;
}

.water-tracker-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-xl);
    align-items: start;
}

/* Tracker Card */

.tracker-card {
    padding: var(--spacing-xl);
}

.btn-settings {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border: 2px solid rgba(102, 126, 234, 0.4);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    position: relative;
    overflow: hidden;
}

.btn-settings::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-settings:hover::before {
    width: 300px;
    height: 300px;
}

.btn-settings:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border-color: rgba(102, 126, 234, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

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

.btn-settings svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
}

.btn-settings span {
    position: relative;
    z-index: 1;
}

/* Pulse animation to attract attention */
@keyframes settingsPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

.btn-settings.pulse {
    animation: settingsPulse 2s infinite;
}

/* Water Glass Visualization */

.water-glass-container {
    display: flex;
    justify-content: center;
    margin: var(--spacing-xl) 0;
}

.water-glass {
    position: relative;
    width: 200px;
    height: 300px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 0 20px 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.water-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 50%, #93c5fd 100%);
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.water-wave {
    position: absolute;
    top: -10px;
    left: -50%;
    width: 200%;
    height: 20px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: wave 3s ease-in-out infinite;
}

@keyframes wave {

    0%,
    100% {
        transform: translateX(0) translateY(0);
    }

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

.glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.water-percentage {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: var(--spacing-xs);
}

.water-amount {
    font-size: 1rem;
    color: var(--gray-300);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Quick Add Buttons */

.quick-add-section,
.custom-amount-section {
    margin-bottom: var(--spacing-lg);
}

.quick-add-section h4,
.custom-amount-section h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: var(--spacing-md);
}

.quick-add-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.quick-add-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: var(--spacing-md);
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.quick-add-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

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

.btn-icon {
    font-size: 2rem;
}

.btn-label {
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
}

.btn-sublabel {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Custom Amount Input */

.custom-amount-input {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.custom-amount-input input {
    flex: 1;
}

.custom-amount-input .btn {
    white-space: nowrap;
}

/* Stats Card */

.stats-card {
    padding: var(--spacing-xl);
}

.today-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-item {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

.stat-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

/* History Section */

.history-section {
    margin-bottom: var(--spacing-lg);
}

.history-section h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: var(--spacing-md);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: var(--spacing-sm);
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.history-time {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.history-amount {
    font-size: 1rem;
    font-weight: 600;
    color: #60a5fa;
}

.history-delete {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition-base);
}

.history-delete:hover {
    color: #f87171;
}

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

.empty-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.empty-state span {
    font-size: 0.875rem;
}

/* Achievement */

.achievement-section {
    margin-top: var(--spacing-lg);
}

.achievement-card {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.2));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-lg);
    animation: celebrate 0.6s ease-out;
}

@keyframes celebrate {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.achievement-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.achievement-content h4 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.achievement-content p {
    color: var(--gray-300);
    line-height: 1.5;
}

/* Settings Modal */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    transition: color var(--transition-base);
}

.modal-close:hover {
    color: white;
}

.modal-body {
    padding: var(--spacing-lg);
}

.form-hint {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

.preset-targets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.preset-btn {
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--gray-300);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.preset-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: white;
}

/* Responsive */

@media (max-width: 768px) {
    .water-tracker-wrapper {
        grid-template-columns: 1fr;
    }

    .today-stats {
        grid-template-columns: 1fr;
    }

    .quick-add-buttons {
        grid-template-columns: 1fr;
    }
}