/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f9;
    color: #333;
    display: flex;
    justify-content: flex-start;
    align-items: center; /* Center align items */
    flex-direction: column; /* Change to column to stack header above app container */
    min-height: 100vh;
    padding-top: 20px;
  }
  
  #app {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    padding: 20px;
    padding-bottom: 10px;
    position: relative; /* Add this line */
  }
  
  /* Routine Card */
  .routine-card {
    background-color: #4CAF50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .routine-card:hover {
    background-color: #45a049;
  }
  
  .new-routine-card {
    background-color: #2196F3;
  }
  
  .new-routine-card:hover {
    background-color: #1e88e5;
  }
  
  /* Task Card */
  .task-card {
    min-height: 65px;
    background-color: #f4f4f9;
    color: #333;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 2px solid #4CAF50;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
  }
  
  .task-card:hover {
    background-color: #f0f0f0;
  }
  
  .task-card.completed {
    background-color: #4CAF50;
    color: #fff;
  }

  .task-card::before {
    content: attr(data-placeholder); /* Use placeholder from the data attribute */
    color: #aaa;
    position: absolute;
    pointer-events: none;
    display: none;
  }

  .task-card:empty::before {
    display: block;
  }

  .task-card-container {
    position: relative;
    touch-action: none;
  }

  .task-card-container.dragging {
    opacity: 0.3;
  }

  .task-card-container .delete-icon {
    display: none;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: red;
    cursor: pointer;
  }

  .task-card-container:hover .delete-icon {
    display: block;
  }

  #app.no-hover .delete-icon {
    display: none !important;
  }

  .new-task-card {
    background-color: #e0e0e0;
    color: #333;
    border: 2px dashed #4CAF50;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .new-task-card:hover {
    background-color: #d5d5d5;
  }

  .task-card .emoji {
    font-size: 2em;
    padding: 0 5px;
  }

  button {
    background-color: #FF5722;
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
  }
  
  button:hover {
    background-color: #e64a19;
  }
  
  h1 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
  }

  .icon-button {
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 10px;
    font-size: 24px;
  }
  
  .icon-button.left {
    left: 10px;
  }
  
  .icon-button.right {
    right: 10px;
  }
  
  .icon-button i {
    pointer-events: none;
  }

  .icon-button:hover {
    background: none; /* Ensure no background on hover */
  }

  /* Add to Home Screen Balloon */
  #add-to-home-screen {
    display: none;
    position: fixed;
    width: 250px;
    max-width: 80%;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    z-index: 1000;
  }

  #add-to-home-screen::after {
    content: '';
    position: absolute;
    bottom: -10px; /* Position the arrow */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #333; /* Same color as the balloon */
  }

  #add-to-home-screen button {
    background-color: #FF5722;
    color: white;
    padding: 5px 10px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-left: 10px;
  }

  #add-to-home-screen button:hover {
    background-color: #e64a19;
  }

  .import-export-container {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
  }

  .import-export-container a {
    color: #2196F3;
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
  }

  .import-export-container a:hover {
    text-decoration: underline;
  }

  #header {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%; /* Ensure header takes full width */
    max-width: 480px; /* Match the max-width of the app container */
  }

  #mascot {
    height: 50px;
    margin-right: auto;
    margin-left: 20px;
    filter: drop-shadow(0 6px 8px rgba(170, 0, 0, 0.7));
  }

  #settings-icon {
    color: lightgray;
    margin-left: auto;
    margin-right: 20px;
    padding-left: 26px;
    cursor: pointer;
  }

  #header h1 {
    margin: 0;
    font-size: 42px;
    font-family: "DynaPuff", serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    font-variation-settings: "wdth" 100;
  }

  #settings-menu {
    position: absolute;
    top: 25px;
    right: 45px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    z-index: 1000;
  }

  .menu-item {
    color: #333;
    font-size: 16px;
    padding: 8px 25px;
    cursor: pointer;
    transition: background 0.3s ease;
  }

  .menu-item:hover {
    background-color: #f0f0f0;
  }

  #settings-menu.hidden {
    display: none;
  }

  #menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
  }

  #menu-overlay.hidden {
    display: none;
  }

  .progress-bar-container {
    width: 100%;
    max-width: 480px;
    background: repeating-linear-gradient(
      30deg,
      #FF8A8A 0px,
      #FFBF8A 60px,
      #FFFF8A 120px,
      #8AFFA3 180px,
      #8AC6FF 240px,
      #8AFFA3 300px,
      #FFFF8A 360px,
      #FFBF8A 420px,
      #FF8A8A 480px
    );
    background-size: 960px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    animation: gradientAnimation 8s linear infinite;
  }

  @keyframes gradientAnimation {
    0% {
      background-position: 0;
    }
    100% {
      background-position: 960px;
    }
  }

  .progress-bar {
    position: relative;
    height: 20px;
    background-color: #e0e0e0;
    width: 100%;
    transition: left 0.3s ease;
  }

  .full-screen-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
      30deg,
      rgba(255, 138, 138, 0.8) 0px,
      rgba(255, 191, 138, 0.8) 60px,
      rgba(255, 255, 138, 0.8) 120px,
      rgba(138, 255, 163, 0.8) 180px,
      rgba(138, 198, 255, 0.8) 240px,
      rgba(138, 255, 163, 0.8) 300px,
      rgba(255, 255, 138, 0.8) 360px,
      rgba(255, 191, 138, 0.8) 420px,
      rgba(255, 138, 138, 0.8) 480px
    );
    background-size: 960px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 10000;
    animation: fadeIn 1s ease-out, gradientAnimation 8s linear infinite;
  }
  
  .full-screen-effect .message {
    font-weight: bold;
    font-size: 48px;
    text-align: center;
    margin-top: 20px;
    animation: zoomIn 0.5s ease-out;
  }

  .full-screen-effect button {
    visibility: hidden; /* Ensure button takes up space but is not visible */
    margin-bottom: 20px;
  }

  .full-screen-effect button.visible {
    visibility: visible; /* Make button visible when needed */
    animation: zoomIn 0.5s ease-out;
  }

  .gif-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  
  @keyframes zoomIn {
    from {
      transform: scale(0.5);
    }
    to {
      transform: scale(1);
    }
  }