/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Sinhala:wght@400;700&display=swap');

/* Base Styles */
body {
  font-family: 'Poppins', 'Noto Sans Sinhala', sans-serif;
  scroll-behavior: smooth;
}

/* Map Styles */
#map {
  width: 100%;
  height: 480px;
  border-radius: 20px;
}

/* Loader Styles */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

#loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

#loader img {
  width: 150px;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 54, 0, 0.7);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 54, 0, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 80px 60px rgba(255, 54, 0, 0.4);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 54, 0, 0.0);
    transform: scale(1);
  }
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(45deg, #FF3600, #FF6B00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Card Hover Effects */
.card-hover {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(255, 54, 0, 0.2);
}

/* Animations */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

.scroll-indicator {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Dark Mode Switch */
.dark-mode-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.dark-mode-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dark-mode-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.dark-mode-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .dark-mode-slider {
  background-color: #FF3600;
}

input:checked + .dark-mode-slider:before {
  transform: translateX(26px);
}

.dark-mode-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: white;
}

.sun-icon {
  left: 6px;
}

.moon-icon {
  right: 6px;
}

/* AI Chatbot Styles */
.chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: 'Poppins', 'Noto Sans Sinhala', sans-serif;
}

.chatbot-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(45deg, #FF3600, #FF6B00);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 54, 0, 0.4);
  transition: all 0.3s ease;
}

.chatbot-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(255, 54, 0, 0.5);
}

.chatbot-window {
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 10px;
}

.chatbot-header {
  background: linear-gradient(45deg, #FF3600, #FF6B00);
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-title h3 {
  margin: 0;
  font-weight: 600;
}

.chatbot-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 18px;
}

.chatbot-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 80%;
  padding: 10px 15px;
  border-radius: 18px;
  word-wrap: break-word;
}

.user-message {
  align-self: flex-end;
  background: #FF3600;
  color: white;
  border-bottom-right-radius: 5px;
}

.bot-message {
  align-self: flex-start;
  background: #f1f5f9;
  color: #334155;
  border-bottom-left-radius: 5px;
}

.chatbot-input {
  display: flex;
  padding: 15px;
  border-top: 1px solid #e5e7eb;
  background: white;
}

.chatbot-input input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #d1d5db;
  border-radius: 25px;
  outline: none;
  font-family: 'Poppins', 'Noto Sans Sinhala', sans-serif;
}

.chatbot-send {
  background: #FF3600;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin-left: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 15px;
  background: #f1f5f9;
  border-radius: 18px;
  border-bottom-left-radius: 5px;
  width: fit-content;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.chatbot-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chatbot-option {
  background: #f1f5f9;
  border: none;
  border-radius: 15px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-option:hover {
  background: #e2e8f0;
}

.chatbot-credits {
  font-size: 10px;
  color: #9ca3af;
  text-align: center;
  padding: 5px;
}

/* Page Animations */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in 1s ease-out forwards;
}

.animate-slide-up {
  animation: fade-in 1.3s ease-out forwards;
}

/* Enhanced Countdown Styles */
.countdown-section {
    position: relative;
    overflow: hidden;
}

.countdown-header {
    position: relative;
}

.countdown-nav-btn {
    background: rgba(255, 54, 0, 0.1);
    border: 2px solid #FF3600;
    color: #FF3600;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.countdown-nav-btn:hover:not(:disabled) {
    background: #FF3600;
    color: white;
    transform: scale(1.1);
}

.countdown-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #9ca3af;
    color: #9ca3af;
}

.countdown-progress-container {
    max-width: 400px;
    margin: 0 auto;
}

.countdown-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.dark .countdown-progress-bar {
    background: #374151;
}

.countdown-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease, background 0.5s ease;
}

.countdown-item {
    background: linear-gradient(135deg, #FF3600, #FF6B00);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    min-width: 80px;
    box-shadow: 0 8px 25px rgba(255, 54, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.countdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.countdown-item:hover::before {
    left: 100%;
}

.countdown-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.countdown-label {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 600;
}

.countdown-separator {
    color: #FF3600;
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    margin: 0 0.5rem;
}

.countdown-flip {
    animation: countdownFlip 0.6s ease-in-out;
}

.countdown-pulse {
    animation: countdownPulse 0.6s ease-in-out;
}

@keyframes countdownFlip {
    0% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

@keyframes countdownPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.countdown-controls {
    gap: 1rem;
}

.countdown-control-btn {
    background: white;
    border: 2px solid #e5e7eb;
    color: #374151;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.dark .countdown-control-btn {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.countdown-control-btn:hover {
    border-color: #FF3600;
    color: #FF3600;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 54, 0, 0.2);
}

.countdown-paused .countdown-item {
    opacity: 0.7;
    filter: grayscale(0.5);
}

.countdown-paused .countdown-value {
    animation: none !important;
}

.countdown-details {
    border: 1px solid #e5e7eb;
}

.dark .countdown-details {
    border-color: #374151;
}

.countdown-details h4 {
    border-bottom: 2px solid;
    border-image: linear-gradient(45deg, #FF3600, #FF6B00) 1;
    padding-bottom: 0.5rem;
}

.countdown-details ul li {
    padding: 0.25rem 0;
}

/* Fullscreen Modal */
.countdown-fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FF3600, #FF6B00);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.countdown-fullscreen-modal.open {
    opacity: 1;
}

.fullscreen-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: background 0.3s ease;
}

.fullscreen-close:hover {
    background: rgba(255,255,255,0.3);
}

.fullscreen-countdown {
    text-align: center;
    color: white;
}

.fullscreen-time-unit {
    display: inline-block;
    margin: 0 1rem;
}

.fullscreen-value {
    font-size: 4rem;
    font-weight: 800;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.fullscreen-label {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.fullscreen-separator {
    font-size: 3rem;
    font-weight: bold;
    opacity: 0.7;
}

.fullscreen-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.fullscreen-action-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.fullscreen-action-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

/* Celebration Styles */
.celebration-message {
    background: rgba(0,0,0,0.8);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.confetti {
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .countdown-item {
        min-width: 70px;
        padding: 0.75rem 1rem;
    }
    
    .countdown-value {
        font-size: 1.5rem;
    }
    
    .countdown-separator {
        font-size: 1.5rem;
        margin: 0 0.25rem;
    }
    
    .fullscreen-value {
        font-size: 2.5rem;
    }
    
    .fullscreen-separator {
        font-size: 2rem;
    }
    
    .countdown-control-btn .control-text {
        display: none;
    }
    
    .countdown-control-btn {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .countdown-item {
        min-width: 60px;
        padding: 0.5rem 0.75rem;
    }
    
    .countdown-value {
        font-size: 1.25rem;
    }
    
    .countdown-separator {
        display: none;
    }
}

/* Enhanced Notification Styles */
.in-app-notification {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    backdrop-filter: blur(10px);
}

.dark .in-app-notification {
    border-color: #374151;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.in-app-notification.success {
    border-left-color: #10B981;
}

.in-app-notification.error {
    border-left-color: #EF4444;
}

.in-app-notification.warning {
    border-left-color: #F59E0B;
}

.in-app-notification.info {
    border-left-color: #3B82F6;
}

.notification-permission-guide {
    animation: slideInUp 0.3s ease;
}

.notification-settings-guide {
    animation: fadeIn 0.3s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Notification Settings Panel */
.notification-settings-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.dark .notification-settings-panel {
    background: #1f2937;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.notification-setting-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.dark .notification-setting-group {
    border-bottom-color: #374151;
}

.notification-setting-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.notification-setting-label {
    display: flex;
    align-items: center;
    justify-content: between;
    margin-bottom: 8px;
}

.notification-setting-label span {
    font-weight: 500;
    color: #374151;
}

.dark .notification-setting-label span {
    color: #f3f4f6;
}

.notification-setting-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 4px;
}

.dark .notification-setting-description {
    color: #9ca3af;
}

/* Toggle Switch */
.notification-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.notification-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.notification-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: .4s;
    border-radius: 24px;
}

.dark .notification-toggle-slider {
    background-color: #4b5563;
}

.notification-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .notification-toggle-slider {
    background-color: #FF3600;
}

input:checked + .notification-toggle-slider:before {
    transform: translateX(26px);
}

.notification-toggle.enabled .notification-toggle-slider {
    background-color: #FF3600;
}

.notification-toggle.disabled .notification-toggle-slider {
    background-color: #d1d5db;
}

/* Quiet Hours Picker */
.quiet-hours-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiet-hours-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
}

.dark .quiet-hours-input {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

/* Notification History */
.notification-history {
    max-height: 300px;
    overflow-y: auto;
}

.notification-history-item {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dark .notification-history-item {
    border-bottom-color: #374151;
}

.notification-history-item:last-child {
    border-bottom: none;
}

.notification-history-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-history-icon.success {
    background: #10B981;
    color: white;
}

.notification-history-icon.error {
    background: #EF4444;
    color: white;
}

.notification-history-icon.warning {
    background: #F59E0B;
    color: white;
}

.notification-history-icon.info {
    background: #3B82F6;
    color: white;
}

.notification-history-content {
    flex: 1;
}

.notification-history-title {
    font-weight: 500;
    color: #374151;
    margin-bottom: 2px;
}

.dark .notification-history-title {
    color: #f3f4f6;
}

.notification-history-message {
    font-size: 0.875rem;
    color: #6b7280;
}

.dark .notification-history-message {
    color: #9ca3af;
}

.notification-history-time {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
}

/* Test Notification Button */
.test-notification-btn {
    background: #FF3600;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.test-notification-btn:hover {
    background: #E63100;
}

/* Responsive Design */
@media (max-width: 768px) {
    .in-app-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification-permission-guide {
        left: 10px;
        right: 10px;
    }
    
    .quiet-hours-picker {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Animation for new notifications */
@keyframes notificationPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 54, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 54, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 54, 0, 0);
    }
}

.notification-pulse {
    animation: notificationPulse 2s infinite;
}

