/* Top Banner */
.top-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: static; /* Not sticky, just normal flow */
  z-index: 900;
}

.banner-content {
  max-width: 1200px;
  margin: 0 auto;
  justify-content: space-between;
  gap: 1rem;
}

.banner-content,.banner-links {
  display: flex;
  align-items: center;
}

.banner-links {
  gap: 1.5rem;
  flex-wrap: wrap;
}

.banner-link {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}

.banner-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.banner-link i {
  font-size: 1.1rem;
}

.banner-hide {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.banner-hide:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* General Styles */
:root {
    --header-height: 60px;
    --padding-mobile: 1rem;
    --padding-desktop: 2rem;
    --max-width: 1200px;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    margin: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #222;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    margin-top: 30px;
    color: #444;
}

button {
    background-color: #0057a0;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
}

button:hover {
    background-color: #004080;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}


hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 20px 0;
}

.result {
    margin-top: 8px;
    font-size: 0.9rem;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    transition: opacity 0.3s ease-out;
}

.result.success {
    color: green;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.result.error {
    color: red;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}


.quest-list, .task-list {
    margin-top: 10px;
    padding-left: 10px;
  }

  .quest-item, .task-item {
    margin-bottom: 4px;
    font-size: 0.95rem;
  }

  /* Add to your existing styles */
  .checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
  }
  
  .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
  }
  
  .checkbox-label:hover {
    background-color: #e9ecef;
    background-color: #e9ecef;
  }

  .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #7CB9E8;
    width: 16px;
    height: 16px;
  }

  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }

  .header button {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
  }

  .header button:hover {
    background-color: #e0e0e0;
  }

  .quest-list {
    margin: 20px 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    max-height: 1000px;
  }

  .quest-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #7CB9E8;
  transition: background 0.2s, transform 0.2s;
  }

  .quest-item h5 {
    margin: 0 0 8px 0;
    color: #2E5090;
    font-size: 1.1em;
  }

  .quest-item p {
    margin: 4px 0;
    color: #666;
    font-size: 0.9em;
  }

  .quest-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-right: 8px;
  }

  .quest-type-habit {
    background-color: #E6F3FF;
    color: #2E5090;
  }

  .quest-type-chore {
    background-color: #FFE5CC;
    color: #CC7700;
  }

  .quest-xp {
    color: #FFA500;
    font-weight: bold;
  }

  .quest-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 20px auto;
  }

  .quest-form form {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .quest-form label {
    display: block;
    margin-bottom: 4px;
    color: #2E5090;
    font-weight: 500;
  }

  .quest-form input[type="text"],
  .quest-form input[type="number"],
  .quest-form select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
  }

  .quest-form button[type="submit"] {
    background-color: #7CB9E8;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    align-self: flex-start;
  }

  .quest-form button[type="submit"]:hover {
    background-color: #5A9BD4;
  }

  .add-child-section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }

  .child-form {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
  }

  .child-form form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 400px;
  }

  .child-form input {
    width: 100%;
  }

  .child-form input,.child-form input[type="number"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
  }

  .child-form input[type="number"] {
    width: 100px;
  }

  .child-form .form-row {
    margin-bottom: 16px;
  }

  .child-form label {
    display: block;
    margin-bottom: 4px;
    color: #2E5090;
    font-weight: 500;
  }

  .child-form input:focus {
    outline: none;
    border-color: #7CB9E8;
    box-shadow: 0 0 0 2px rgba(124, 185, 232, 0.2);
  }

  .child-form button {
    align-self: flex-start;
  }

  .children-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
  }

  .child-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }

  .child-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
  }

  .child-header h3 {
    margin: 0;
    flex-grow: 1;
  }

  .child-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }

  .child-content.collapsed {
    max-height: 0;
  }

  .collapse-icon {
    transition: transform 0.3s ease;
    transition: transform 0.3s ease;
  }

  .collapse-icon.collapsed {
    transform: rotate(-90deg);
    transform: rotate(-90deg);
  }

  .error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #fff3f3;
    border: 1px solid #ffcdd2;
    border-left: 4px solid #f44336;
    padding: 16px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 400px;
}

.error-notification h4 {
    margin: 0 0 8px 0;
    color: #d32f2f;
}

.error-notification p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}
.admin-menu {
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 4px;
  margin: 10px 0;
}

.login-code-result {
    display: none;
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    animation: fadeIn 0.3s ease-in;
}

.login-code-result:not(:empty) {
    display: block;
}

.login-code-result .success {
    color: #28a745;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-code-result .error {
    color: #dc3545;
}

.login-code-result .validity {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}


.note {
  font-size: 0.9em;
  color: #666;
}

.admin-dropdown {
  position: relative;
  display: inline-block;
  float: right;
  margin: 8px;
}

.menu-icon {
    cursor: pointer;
    font-size: 25px;
    font-weight: bold;
    padding: 5px;
    color: #666;
    transition: transform 0.2s ease;
}

.menu-icon:hover {
    transform: rotate(45deg);
    color: #333;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 4px;
}

.dropdown-content button {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
}

.dropdown-content button:hover {
  background-color: #f1f1f1;
}

.show {
  display: block;
}

.date-picker {
    margin: 1em 0;
}

.date-controls {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.date-controls button {
    padding: 0.5em;
    cursor: pointer;
}

.form-container {
    max-width: 500px;
    margin: 1em 0;
    padding: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.form-group {
    margin-bottom: 15px;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.auth-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 300px;
  margin: 0 auto;
}

.auth-form {
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    width: 100%;
}

.auth-tab {
    padding: 10px 20px;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 16px;
    opacity: 1;
    transition: all 0.3s ease;
}

.auth-tab:hover,.auth-tab.active {
    color: #489fd1;
}

.auth-tab.active {
    border-bottom: 2px solid #489fd1;
}

.auth-panel {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-panel.active {
    display: block;
    opacity: 1;
}

.password-requirements {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  color: #666;
}

.password-requirements li {
  list-style: none;
  padding-left: 1.5rem;
  position: relative;
}

.password-requirements li::before {
  content: '✕';
  position: absolute;
  left: 0;
  color: #ff4444;
}

.password-requirements li.met::before {
  content: '✓';
  color: #44ff44;
}

.divider {
  text-align: center;
  margin: 1rem 0;
  color: #666;
}

.forgot-password {
  display: block;
  text-align: right;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #489fd1;
}

.verification-banner {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.verification-message {
    flex: 1;
}

.verification-button {
    background-color: #856404;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.verification-button:hover {
    background-color: #6d5204;
}

.app-header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
}

.app-header,.header-content {
    display: flex;
    align-items: center;
    padding: 0 var(--padding-mobile);
    display: flex;
    align-items: center;
    padding: 0 var(--padding-mobile);
}

.header-content {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    justify-content: space-between;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    justify-content: space-between;
    width: 100%;
    padding: 0 var(--padding-mobile);
}

/* Main content padding */
main {
    padding-top: calc(var(--header-height) + 1rem);
}

/* Landing page specific */
.landing-content {
    padding-top: calc(var(--header-height) + 2rem);
    margin-top: var(--header-height);
    padding: 2rem var(--padding-mobile);
    max-width: var(--max-width);
}

/* Auth container specific */
.auth-container {
    margin-top: 2rem;
}

@media (max-width: 768px) {
    main {
        padding-top: var(--header-height);
        padding-top: var(--header-height);
    }
    
    .auth-container {
        margin-top: 1rem;
        margin-top: 1rem;
    }
}

.account-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;  /* Add this */
    right: 0;           /* Add this */
    top: 50%;           /* Add this */
    transform: translateY(-50%);  /* Add this */
}

.account-button:hover {
    background-color: rgba(0,0,0,0.05);
}

.account-menu {
    position: absolute;
    top: calc(100% + 0.5rem);  /* Adjust this */
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1001;
}

.menu-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background-color: #f5f5f5;
}

.profile-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.menu-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #eee;
}

.menu-profile-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.menu-user-info {
    display: flex;
    flex-direction: column;
}

.menu-user-name {
    font-weight: 600;
    color: #333;
}

.menu-user-email {
    font-size: 0.875rem;
    color: #666;
}

.menu-divider {
    height: 1px;
    background-color: #eee;
    margin: 0.5rem 0;
}

/* Adjust main content for fixed header */
.content-container {
    margin-top: 4rem;
}

.login-options {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.deep-link-button, .copy-link-button {
    border: none;
    transition: background-color 0.2s;
}

.deep-link-button, .copy-link-button,.deep-link-button {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.deep-link-button {
    display: inline-block;
    text-decoration: none;
    background-color: #4CAF50;
    color: white;
    border: none;
    font-family: inherit;
    font-size: inherit;
}

.copy-link-button {
    background-color: #2196F3;
    color: white;
}

.deep-link-button:hover {
    background-color: #45a049;
}

.copy-link-button:hover {
    background-color: #1976D2;
}

.quest-section {
    margin: 1rem 0;
}

.quest-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.quest-header:hover {
    background-color: #eee;
}

.quest-list.collapsed {
    max-height: 0;
}

@media (max-width: 768px) {
    .code-result {
        margin: 0.5rem 0;
        padding: 0.75rem;
    }
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.header-nav {
    display: flex;
    gap: 1rem;
}

.nav-button {
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    border: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.nav-button:hover {
    background-color: #0056b3;
}


/* Main content containers */
#app, .auth-container, .landing-content {
    padding-top: calc(var(--header-height) + 1rem);
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: var(--padding-mobile);
    padding-right: var(--padding-mobile);
}

/* Verification banner adjustments */
#verificationBanner {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 999;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .app-header {
        padding: 0 var(--padding-desktop);
        padding: 0 var(--padding-desktop);
    }

    #app, .auth-container, .landing-content {
        padding-left: var(--padding-desktop);
        padding-right: var(--padding-desktop);
        padding-left: var(--padding-desktop);
        padding-right: var(--padding-desktop);
    }
}

/* Remove conflicting styles */

.auth-container,.landing-content {
    margin-top: 0;
}

/* Add these styles for Google button */
.google-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    background-color: white;
    color: #3c4043;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.google-button:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.google-button:active {
    background-color: #f1f3f4;
}

.google-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.auth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2rem 0;  /* Increased from 1rem */
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.auth-separator span {
    padding: 0 1rem;
    color: #666;
}

.social-auth {
    margin-top: 1rem;  /* Add this */
}

.auth-button {
    margin-bottom: 1rem;  /* Add this */
}

.app-footer {
    background-color: #f8f9fa;
    padding: 1rem 0;
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem var(--padding-mobile);
    padding: 1rem var(--padding-mobile);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-end;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.social-links a {
    color: #6c757d;
    font-size: 1.25rem;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f8f9fa;
}

.social-links a:hover {
    color: #3498db;
    background-color: #e9ecef;
}

.social-links .fab {
    font-size: 18px;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        padding: 1.5rem var(--padding-mobile);
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-links {
        align-items: center;
    }

    .social-links {
        margin-top: 1rem;
    }
}

/* Brand and Logo styles */
.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.header-logo {
    height: 40px;
    width: auto;
    max-width: 200px; /* Prevent overly wide logos */
}

.footer-logo {
    height: 32px;
    width: auto;
    max-width: 160px;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Header layout */

/* Footer layout */
.header-content,.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.copyright {
    font-size: 0.875rem;
    color: #6c757d;
}

@media (max-width: 768px) {

    .footer-brand {
        align-items: center;
    }
}

/* Support for high DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .header-logo {
        image-rendering: -webkit-optimize-contrast;
    }
}

.invite-result,.invite-parent-form {
    margin: 10px 0;
}

.invite-parent-form {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
}

.invite-parent-form h4 {
    margin-top: 0;
    color: #2E5090;
}

.invite-parent-form .form-group {
    margin-bottom: 15px;
}

.invite-parent-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.invite-parent-form input[type="email"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.invite-parent-form .form-buttons {
    display: flex;
    gap: 10px;
}

.invite-parent-form .primary-button,
.invite-parent-form .secondary-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.invite-parent-form .primary-button {
    background: #2E5090;
    color: white;
}

.invite-parent-form .secondary-button {
    background: #ccc;
    color: #333;
}

.invite-result .success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}

.invite-result .error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

/* Loading spinner */
.spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading state for result divs */
.loading {
    padding: 1rem;
    background: #e3f2fd;
    border-left: 4px solid #2E5090;
    border-radius: 4px;
    color: #2E5090;
    display: flex;
    align-items: center;
}

/* Disabled state for buttons */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

/* Success message improvements */
.success {
    padding: 1rem;
    background: #e8f5e9;
    border-left: 4px solid #28a745;
    border-radius: 4px;
    color: #155724;
}

.success strong {
    color: #0d3d1a;
}

/* Error message improvements */
.error {
    padding: 1rem;
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
    color: #721c24;
}

/* Progress Overview Section */
.progress-section {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.progress-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    color: white;
}

.progress-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.progress-stat {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.stat-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-percent {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Today's Stats */
.today-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0.75rem 0;
}

.today-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.today-number {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    display: block;
    white-space: nowrap;
}

.today-label {
    font-size: 0.75rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

/* Today's Visual */
.today-visual {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.filled-dots {
    color: #FFD700;
}

.empty-dots {
    color: rgba(255, 255, 255, 0.3);
}

.overflow {
    font-size: 0.9rem;
    margin-left: 0.5rem;
    opacity: 0.9;
}

/* Loading State */
.progress-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: white;
}

.progress-error {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Calendar Section Wrapper */
.calendar-section {
  margin-top: 2rem;
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Desktop: Show grid, hide list */
.calendar-grid-view {
  display: block;
}

.calendar-list-view {
  display: none;
}

/* Calendar List View Styles */
.calendar-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.calendar-list-day {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.calendar-list-day.today {
  border: 2px solid #2E5090;
  box-shadow: 0 2px 8px rgba(46, 80, 144, 0.2);
}

.calendar-list-day.past {
  opacity: 0.7;
}

.list-day-header {
  justify-content: space-between;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.list-day-header,.list-day-date {
  display: flex;
  align-items: center;
}

.list-day-date {
  gap: 0.75rem;
}

.list-day-number {
  font-size: 1.75rem;
  font-weight: bold;
  line-height: 1;
}

.list-day-name {
  font-size: 0.9rem;
  opacity: 0.9;
}

.today-badge {
  background: rgba(255, 255, 255, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-left: 0.5rem;
}

.yesterday-badge {
  background: rgba(158, 158, 158, 0.3);
}

.tomorrow-badge {
  background: rgba(76, 175, 80, 0.3);
}

.list-day-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.list-task-count {
  font-size: 1.25rem;
  font-weight: bold;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
}

.list-task-count.complete {
  background: rgba(76, 175, 80, 0.3);
}

.list-day-tasks {
  padding: 0.5rem;
}

.list-task {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
}

.list-task:last-child {
  border-bottom: none;
}

.list-task:hover {
  background: #f8f9fa;
}

.list-task.completed {
  opacity: 0.7;
}

.list-task.completed .task-name {
  text-decoration: line-through;
}

.task-status-icon {
  font-size: 1.25rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-task.completed .task-status-icon {
  color: #4CAF50;
}

.task-name {
  flex: 1;
  font-size: 0.95rem;
}

.task-xp {
  font-size: 0.85rem;
  color: #666;
  font-weight: 600;
  background: #fff3cd;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
}

.no-tasks-message {
  text-align: center;
  padding: 2rem;
  color: #999;
  font-style: italic;
}

.calendar-expand-btn {
  width: 100%;
  padding: 1rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.calendar-expand-btn:hover {
  opacity: 0.9;
}

.calendar-expand-btn:active {
  transform: scale(0.98);
}

/* Mini Progress Bars for Today's Stats */
.mini-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.overflow-text {
    opacity: 0.8;
}

.overflow-text,.day-badge {
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.day-badge {
  background: rgba(255, 255, 255, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: bold;
}

/* Mobile Responsive - Switch to List View */
@media (max-width: 768px) {
  .calendar-grid-view {
    display: none !important;
  }
  
  .calendar-list-view {
    display: block !important;
  }
  
  .calendar-header h3 {
    font-size: 1.1rem;
  }
  
  .calendar-header button {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
  
  .calendar-section {
    padding: 0.75rem;
  }
  
  .progress-overview,.today-stats {
    grid-template-columns: 1fr;
  }
}

/* Tablet - Smaller grid cells */
@media (max-width: 1024px) and (min-width: 769px) {
  .calendar-day {
    min-height: 60px;
    font-size: 0.85rem;
  }
  
  .day-number {
    font-size: 0.8rem;
  }
  
  .day-tasks {
    font-size: 0.7rem;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
}

@media (min-width: 768px) {
}

.list-task.future-task {
  opacity: 0.8;
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.future-badge {
  font-size: 0.75rem;
  color: #667eea;
  font-weight: 600;
  background: rgba(102, 126, 234, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 10px;
  margin-left: 0.5rem;
}

/* Grid view task list - hidden on narrow screens, shown on wide */
.day-task-list {
  display: none;
  margin-top: 0.5rem;
  gap: 0.25rem;
  flex-direction: column;
}

.calendar-task {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.5);
}

.calendar-task.clickable {
  cursor: pointer;
}

.calendar-task.clickable:hover {
  background: rgba(102, 126, 234, 0.1);
}

.calendar-task.completed {
  opacity: 0.6;
  text-decoration: line-through;
}

.calendar-task.future {
  opacity: 0.7;
  font-style: italic;
}

.task-indicator {
  font-size: 0.875rem;
  font-weight: bold;
  color: #667eea;
}

.calendar-task.completed .task-indicator {
  color: #48bb78;
}

.task-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Show full task list on wide screens (1200px+) */
@media (min-width: 1200px) {
  .day-task-list {
    display: flex;
  }
  
  /* Hide the compact task count on wide screens */
  .day-tasks {
    display: none;
  }
  
  .calendar-day {
    min-height: 120px;
    padding: 0.5rem;
  }
}

/* Adjust calendar grid for better spacing on wide screens */
@media (min-width: 1400px) {
  .calendar-day {
    min-height: 140px;
  }
  
  .calendar-task {
    font-size: 0.8125rem;
  }
}

/* Keep compact view on narrow screens */
@media (max-width: 1199px) {
  .day-tasks {
    display: block;
  }
  
  .day-task-list {
    display: none;
  }
}

.calendar {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  margin-bottom: 1.5rem;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  width: 100%;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.calendar-days,.calendar-day {
  width: 100%;
  box-sizing: border-box;
}

.calendar-day {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.5rem;
  min-height: 60px;
  background: white;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.5rem;
  min-height: 60px;
  background: white;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

/* When expanded, allow growth but add scrolling if needed */
.calendar-day.expanded {
  min-height: auto;
  max-height: 300px;
  overflow-y: auto;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Popup overlay for task list */
.day-task-popup {
  position: absolute;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  flex-shrink: 0;
}

.popup-date {
  font-weight: 600;
  font-size: 0.875rem;
}

.popup-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.popup-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.popup-task-list {
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  max-height: 350px;
}

.popup-task-list,.popup-task {
  display: flex;
  padding: 0.5rem;
}

.popup-task {
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  border-radius: 4px;
  background: rgba(248, 250, 252, 1);
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
}

.popup-task.clickable {
  cursor: pointer;
}

.popup-task.clickable:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: #667eea;
  transform: translateX(2px);
}

.popup-task.completed {
  opacity: 0.6;
}

.popup-task.completed .task-title {
  text-decoration: line-through;
}

.popup-task.future {
  opacity: 0.7;
  font-style: italic;
  background: rgba(255, 248, 225, 1);
}

.popup-task .task-indicator {
  font-size: 1rem;
  font-weight: bold;
  color: #667eea;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.popup-task.completed .task-indicator {
  color: #48bb78;
}

.popup-task .task-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.popup-task .task-xp {
  font-size: 0.75rem;
  color: #667eea;
  font-weight: 600;
  flex-shrink: 0;
}

/* Scrollbar styling for popup */
.popup-task-list::-webkit-scrollbar {
  width: 6px;
}

.popup-task-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.popup-task-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.popup-task-list::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Make task count clickable on narrow screens */
.clickable-count {
  cursor: pointer;
  transition: background 0.2s;
}

.clickable-count:hover {
  background: rgba(102, 126, 234, 0.1);
  border-radius: 4px;
}

/* Calendar day back to normal */

/* Hide popup on wide screens */
@media (min-width: 1200px) {
  
  .day-task-popup,.clickable-count {
    display: none;
  }
}

@media (max-width: 768px) {
  .day-task-popup {
    max-width: 90vw;
    max-height: 300px;
  }
  
  .popup-task-list {
    max-height: 250px;
  }
  
  .popup-task {
    font-size: 0.8125rem;
  }
}

.quest-item:hover {
  background: rgba(102, 126, 234, 0.05);
  transform: translateX(2px);
}

.quest-item.inactive {
  opacity: 0.6;
  background: rgba(0, 0, 0, 0.02);
}

.inactive-badge {
  display: inline-block;
  background: #e53e3e;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
  font-weight: 600;
}

/* Quest Edit Modal positioning */
#questEditModal .modal-content {
  position: fixed;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1001;
}

/* Quest edit modal checkbox group styling */
#questEditModal .checkbox-group {
  gap: 0.5rem;
  margin-top: 0.5rem;
}

#questEditModal .checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

#questEditModal .checkbox-group label:hover {
  background: rgba(102, 126, 234, 0.05);
}

#questEditModal .checkbox-group input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

/* Ensure form groups have proper spacing */
#questEditModal .form-group {
  margin-bottom: 1.5rem;
}

#questEditModal .form-group label:not(.checkbox-group label) {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #2d3748;
}

#questEditModal .form-group input[type="text"],
#questEditModal .form-group input[type="number"],
#questEditModal .form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 1rem;
}

.pending-badge {
  background-color: #ffa500;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  margin-left: 8px;
}

.quest-item.pending {
  border-left: 4px solid #ffa500;
  opacity: 0.85;
}