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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #007aff 0%, #0051d5 25%, #00c6ff 50%, #007aff 75%, #0051d5 100%);
    background-size: 400% 400%;
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 430px;
    margin: 0 auto;
    padding: 24px 20px;
    min-height: 100vh;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 10px;
    animation: fadeInDown 0.6s ease-out;
}

.greeting {
    font-size: 2.4rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    letter-spacing: -1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Poppins', 'Inter', sans-serif;
}

.date {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    letter-spacing: -0.5px;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.4);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    animation-delay: 0.1s;
    animation-fill-mode: both;
}

.streak-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: float 3s ease-in-out infinite;
}

.streak-icon {
    font-size: 2.8rem;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(255, 193, 7, 0.4));
    display: flex;
    align-items: center;
    justify-content: center;
}

.streak-lucide-icon {
    width: 48px;
    height: 48px;
    color: #ffc107;
}

.streak-info {
    flex: 1;
    margin-left: 15px;
}

.streak-label {
    font-size: 0.85rem;
    color: #86868b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.streak-count {
    font-size: 2rem;
    font-weight: 800;
    color: #ffc107;
    letter-spacing: -1px;
    text-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    font-family: 'Poppins', 'Inter', sans-serif;
}

.streak-best {
    text-align: right;
}

.best-label {
    font-size: 0.85rem;
    color: #86868b;
    font-weight: 500;
}

/* Streak Locked Card */
.streak-locked {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    animation: fadeInUp 0.6s ease-out;
    animation-delay: 0.1s;
    animation-fill-mode: both;
}

.locked-icon {
    font-size: 2.8rem;
    animation: pulse 2s ease-in-out infinite;
    filter: grayscale(100%);
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.locked-lucide-icon {
    width: 48px;
    height: 48px;
    color: #86868b;
}

.locked-info {
    flex: 1;
}

.locked-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.locked-subtitle {
    font-size: 0.9rem;
    color: #86868b;
    font-weight: 400;
}

/* Question */
.question-section {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease-out;
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

.question {
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Poppins', 'Inter', sans-serif;
}

/* Buttons */
.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease-out;
    animation-delay: 0.3s;
    animation-fill-mode: both;
}

.btn {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    padding: 20px 28px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.5px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    border-radius: 16px;
    pointer-events: none;
}

.btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    width: 24px;
    height: 24px;
}

.btn-text {
    flex: 1;
    text-align: center;
}

.btn-primary {
    background: #007aff;
    color: white;
}

.btn-clean {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.btn-gambled {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Light On Selected / Unselected States */
.btn.unselected {
    opacity: 0.35 !important;
    filter: grayscale(40%);
    transform: scale(0.96);
}

.btn-clean.selected {
    opacity: 1 !important;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.8), 0 0 10px rgba(16, 185, 129, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.4) !important;
    border: 2px solid #34d399 !important;
    transform: scale(1.02);
    animation: pulseGlowGreen 2s infinite ease-in-out !important;
}

.btn-gambled.selected {
    opacity: 1 !important;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.8), 0 0 10px rgba(239, 68, 68, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.4) !important;
    border: 2px solid #f87171 !important;
    transform: scale(1.02);
    animation: pulseGlowRed 2s infinite ease-in-out !important;
}

@keyframes pulseGlowGreen {
    0%, 100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.8), 0 0 8px rgba(16, 185, 129, 0.5), inset 0 0 12px rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(16, 185, 129, 1), 0 0 15px rgba(16, 185, 129, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.6);
    }
}

@keyframes pulseGlowRed {
    0%, 100% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.8), 0 0 8px rgba(239, 68, 68, 0.5), inset 0 0 12px rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 1), 0 0 15px rgba(239, 68, 68, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.6);
    }
}

.btn-secondary {
    background: linear-gradient(135deg, #007aff 0%, #0051d5 100%);
    color: white;
    margin-top: 16px;
    font-size: 1rem;
    padding: 14px 28px;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.btn-logs {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    border: 2px solid #007aff;
    animation: fadeInUp 0.6s ease-out;
    animation-delay: 0.4s;
    animation-fill-mode: both;
    box-shadow: none;
}

.secondary-buttons {
    display: flex;
    gap: 12px;
    animation: fadeInUp 0.6s ease-out;
    animation-delay: 0.5s;
    animation-fill-mode: both;
}

.btn-secondary-small {
    flex: 1;
    font-size: 1rem;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-secondary-small:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 12px 16px;
    max-width: 280px;
    margin: 16px auto 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.4);
    animation: popIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-message p {
    font-size: 0.9rem;
    color: #1d1d1f;
    margin-bottom: 2px;
    font-weight: 600;
    text-shadow: none;
}

.see-you {
    font-weight: 500;
    color: #007aff;
    font-size: 0.8rem;
}

.hidden {
    display: none !important;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 28px;
    padding: 36px 28px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5);
    animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

.modal-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 16px;
    letter-spacing: -1px;
    font-family: 'Poppins', 'Inter', sans-serif;
}

.modal-text {
    font-size: 1.1rem;
    color: #86868b;
    margin-bottom: 20px;
    font-weight: 400;
}

.name-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Fredoka', sans-serif;
    border: 1px solid #d1d1d6;
    border-radius: 12px;
    margin-bottom: 24px;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    letter-spacing: -0.3px;
}

.name-input:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Logs */
.logs-content {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.logs-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 16px;
    padding-right: 6px;
    max-height: 60vh;
    -webkit-overflow-scrolling: touch; /* smooth scroll on iOS */
}

.logs-list::-webkit-scrollbar {
    width: 4px;
}

.logs-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.logs-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 4px;
}

.log-item {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Compact colored pill row for logs */
.log-item-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    margin-bottom: 6px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.15s ease;
    color: white;
    text-align: center;
}

.log-item-compact.clean {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.log-item-compact.gambled {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.log-item-compact:hover {
    filter: brightness(1.08);
    transform: scale(1.01);
}

.log-date {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.log-status {
    font-size: 0.95rem;
    color: #86868b;
    font-weight: 500;
    letter-spacing: -0.3px;
}

.log-status.clean {
    color: #10b981;
    font-weight: 600;
}

.log-status.gambled {
    color: #ef4444;
    font-weight: 600;
}

.log-detail-status {
    font-size: 1.3rem;
    font-weight: 600;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: -0.3px;
}

.log-detail-status.clean {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.log-detail-status.gambled {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* Confirmation Modal */
.confirm-content {
    padding: 36px 28px;
}

.confirm-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.confirm-lucide-icon {
    width: 64px;
    height: 64px;
    color: #ef4444;
    animation: pulse 2s ease-in-out infinite;
}

.clean-confirm-icon {
    color: #10b981;
}

.gambled-confirm-icon {
    color: #ef4444;
}

.change-icon {
    color: #007aff;
}

.change-confirm-icon {
    color: #f59e0b;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.confirm-buttons .btn {
    flex: 1;
    font-size: 1rem;
    padding: 16px 20px;
}

.change-choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-change-option {
    font-size: 1.1rem;
}

.btn-change-choice {
    margin: 8px auto 0;
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    border: 1px solid #007aff;
    box-shadow: none;
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: fit-content;
    min-width: 100px;
}

.btn-change-choice .btn-icon {
    width: 14px;
    height: 14px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    }
}

/* Responsive */
@media (max-width: 380px) {
    .greeting {
        font-size: 2rem;
    }
    
    .question {
        font-size: 1.5rem;
    }
    
    .btn {
        font-size: 1.1rem;
        padding: 18px 25px;
    }
}

@media (min-width: 431px) {
    .container {
        padding-top: 40px;
        padding-bottom: 40px;
    }
}

/* Download App Badge */
.download-app-badge {
    background: rgba(0, 122, 255, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 500;
    font-size: 0.95rem;
    margin: 16px auto 0;
    width: fit-content;
    min-width: 180px;
    animation: fadeInUp 0.6s ease-out;
    animation-delay: 0.6s;
    animation-fill-mode: both;
}

.download-app-badge:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.5);
    background: rgba(0, 122, 255, 1);
}

.download-badge-icon {
    width: 20px;
    height: 20px;
}

/* Install Modal */
.install-content {
    max-height: 80vh;
    overflow-y: auto;
    padding: 36px 28px;
}

.install-header {
    text-align: center;
    margin-bottom: 24px;
}

.install-app-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.install-steps {
    margin-bottom: 24px;
}

.install-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.install-step:last-child {
    margin-bottom: 0;
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #007aff 0%, #0051d5 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.step-content {
    flex: 1;
}

.step-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.step-desc {
    font-size: 0.9rem;
    color: #86868b;
    font-weight: 400;
    line-height: 1.4;
}

.step-inline-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
}

/* Reminder Alert Modal with Logo */
.reminder-content {
    text-align: center;
    padding: 32px 24px;
}

.reminder-app-logo {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    margin: 0 auto 16px;
    display: block;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    object-fit: cover;
}

/* Notification Disabled Toggle Styling */
.btn.disabled-notif {
    background: rgba(142, 142, 147, 0.25) !important;
    color: #8e8e93 !important;
    border: 1.5px solid rgba(142, 142, 147, 0.4) !important;
    box-shadow: none !important;
}

.btn.disabled-notif .btn-text {
    text-decoration: line-through;
    text-decoration-thickness: 2.5px;
    text-decoration-color: #ef4444;
    opacity: 0.85;
}
