
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family: Arial, sans-serif;
    background-image: url('/static/images/pexels-photo-29054973.jpeg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    color: #2d1810;
    height: 100%;
  }
  
  /* Stars and Twinkles */
  
  .stars {
    position: relative;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .stars::before,
  .stars::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 2px;
    background-color: #fff;
    border-radius: 50%;
    animation: twinkle 2s infinite;
  }
  
  .stars::before {
    animation-delay: 0.5s;
  }
  
  @keyframes twinkle {
    0% {
      opacity: 0;
    }
    50% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }
 
  /* Other Styles */
  
  header {
    background-color: #333;
    color: #741212;
    padding: 20px;
    text-align: center;
  }
  
  main {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
  }
  
  footer {
    background-color: #333;
    color: #fff;
    padding: 20px;
    text-align: center;
    clear: both;
  }
  
  /* Utility Classes */
  
  .center {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .mg-20 {
    margin: 20px;
  }
  
  .pad-20 {
    padding: 20px;
  }

  /* Form and Input Styling for Orange/White Theme */
  .login-container {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #d2691e;
    color: #8b4513;
    box-shadow: 0 4px 8px rgba(210, 105, 30, 0.3);
  }

  .login-container h2 {
    color: #d2691e;
    text-align: center;
    margin-bottom: 20px;
  }

  .login-form input, #todo-section input {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #daa520;
    color: #8b4513;
    font-weight: 500;
  }

  .login-form input:focus, #todo-section input:focus {
    border-color: #ff8c00;
    outline: none;
    box-shadow: 0 0 5px rgba(255, 140, 0, 0.3);
  }

  .login-form button, #todo-section button {
    background: linear-gradient(135deg, #ff8c00, #d2691e);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .login-form button:hover, #todo-section button:hover {
    background: linear-gradient(135deg, #d2691e, #b8860b);
    transform: translateY(-1px);
  }

  .todo-item {
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid #daa520;
    color: #8b4513;
    border-radius: 8px;
  }

  .todo-item.completed {
    background: rgba(245, 245, 245, 0.7);
    color: #a0522d;
  }

  #todo-section h1 {
    color: #1e3a8a;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(30, 58, 138, 0.3);
    letter-spacing: 1px;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
  }

  #todo-section h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #1e3a8a, #3b82f6, #60a5fa);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.3);
  }

  .login-container a {
    color: #d2691e;
    text-decoration: none;
  }

  .login-container a:hover {
    color: #ff8c00;
    text-decoration: underline;
  }

  .error-message {
    color: #dc143c;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 4px;
    border-left: 4px solid #dc143c;
  }

  .edit-btn {
    background: linear-gradient(135deg, #3b82f6, #1e40af) !important;
    color: white !important;
  }

  .edit-btn:hover {
    background: linear-gradient(135deg, #1e40af, #1e3a8a) !important;
  }

  /* Overdue todo styling */
  .todo-item.overdue {
    background: rgba(255, 235, 235, 0.95) !important;
    border: 2px solid #dc2626 !important;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.3);
  }

  .todo-item.overdue:hover {
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.4);
  }

  .due-date-display {
    font-size: 0.85em;
    color: #666;
  }

  .overdue-text {
    color: #dc2626 !important;
    font-weight: 600;
    animation: pulse-warning 2s ease-in-out infinite;
  }

  @keyframes pulse-warning {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.7;
    }
  }

  /* ============================================
     TAG STYLES
     Many-to-many relationship UI components
     ============================================ */

  /* Tags container on todo items */
  .todo-tags-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    position: relative;
  }

  .todo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  /* Individual tag badge */
  .tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
    border: 1px solid;
    transition: all 0.2s ease;
  }

  .tag-badge:hover {
    transform: scale(1.05);
  }

  /* Remove tag button */
  .tag-remove-btn {
    background: none !important;
    border: none !important;
    color: inherit !important;
    cursor: pointer;
    font-size: 1.1em;
    line-height: 1;
    padding: 0 !important;
    margin-left: 2px;
    opacity: 0.6;
    transition: opacity 0.2s;
  }

  .tag-remove-btn:hover {
    opacity: 1;
    transform: none !important;
  }

  /* Add tag button */
  .add-tag-btn {
    background: transparent !important;
    border: 1px dashed #aaa !important;
    color: #666 !important;
    padding: 2px 8px !important;
    border-radius: 12px !important;
    font-size: 0.75em !important;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .add-tag-btn:hover {
    border-color: #666 !important;
    color: #333 !important;
    background: rgba(0,0,0,0.05) !important;
    transform: none !important;
  }

  /* Tag picker dropdown */
  .tag-picker {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 200px;
    max-width: 280px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 4px;
  }

  .tag-picker-content {
    padding: 8px;
  }

  .tags-picker-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .tag-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 4px 10px;
    border-radius: 4px;
    transition: background 0.15s;
    font-size: 0.9em;
  }

  .tag-picker-item:hover {
    background: #f5f5f5;
  }

  .tag-picker-select {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
    padding: 4px 0;
  }

  .tag-picker-delete {
    background: none !important;
    border: none !important;
    color: #999 !important;
    cursor: pointer;
    font-size: 1.1em;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    opacity: 0;
    transition: all 0.15s;
  }

  .tag-picker-item:hover .tag-picker-delete {
    opacity: 1;
  }

  .tag-picker-delete:hover {
    color: #dc2626 !important;
    background: rgba(220, 38, 38, 0.1) !important;
    transform: none !important;
  }

  /* Tag color dot */
  .tag-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* Quick tag form in picker */
  .quick-tag-form {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-top: 1px solid #eee;
    margin-top: 4px;
  }

  .quick-tag-form input[type="text"] {
    flex: 1;
    padding: 4px 8px !important;
    font-size: 0.85em !important;
    border-radius: 4px !important;
  }

  .quick-tag-form input[type="color"] {
    width: 30px !important;
    height: 26px !important;
    padding: 0 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    cursor: pointer;
  }

  .quick-tag-form button {
    padding: 4px 10px !important;
    font-size: 0.85em !important;
  }

  /* ============================================
     TAG MANAGEMENT STYLES
     For the tags management page/section
     ============================================ */

  .tag-manage-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 8px;
  }

  .tag-color-preview {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .tag-name {
    flex: 1;
    font-weight: 500;
  }

  .tag-actions {
    display: flex;
    gap: 4px;
  }

  .tag-edit-btn, .tag-delete-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 4px !important;
    font-size: 1em;
    opacity: 0.6;
    transition: opacity 0.2s;
  }

  .tag-edit-btn:hover, .tag-delete-btn:hover {
    opacity: 1;
    transform: none !important;
  }

  /* ============================================
     TAG STATISTICS STYLES
     ============================================ */

  .tag-stats-container {
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
  }

  .tag-stats-container h3 {
    margin-bottom: 16px;
    color: #333;
  }

  .tag-stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .tag-stat-item {
    padding: 12px;
    background: #f8f8f8;
    border-radius: 6px;
  }

  .tag-stat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .tag-stat-name {
    font-weight: 600;
    color: #333;
  }

  .tag-stat-counts {
    display: flex;
    gap: 16px;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
  }

  .tag-progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
  }

  .tag-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 3px;
    transition: width 0.3s ease;
  }

  .no-stats {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
  }