body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: #f0f2f5; 
}

main.container {
    max-width: 1200px;
}

#login-container,
#register-container {
    margin-left: auto;
    margin-right: auto;
    border: none; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); 
    overflow: hidden; 
}

#login-container {
    max-width: 1000px; 
    width: 100%;
}

#register-container {
    max-width: 500px; 
}

#login-image {
    width: 100%;
    object-fit: cover; 
    transition: filter 0.3s ease-in-out;
}

#login-container .card-body,
#register-container .card-body {
    padding: 2.5rem; 
}

#logout-btn {
    background-color: transparent;
    border: none;
    color: #dc3545;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
}

#logout-btn:hover {
    color: #a71d2a;
    text-decoration: underline;
}

.task-card .description-text {
    word-break: break-word;
}

#task-list {
    background-color: #f8f9fa;
}

.date-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #343a40;
    color: #f8f9fa;
    font-size: 0.875rem;
    padding: 4px 10px;
    border-radius: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease;
}

.date-pill:hover {
    background-color: #495057;
    cursor: default;
}

.date-pill i {
    font-size: 0.9rem;
    opacity: 0.8;
}

body:not(.dark-mode) .date-pill {
    background-color: #e9f2ff;
    color: #0d6efd;
    border: 1px solid #b6d4fe;
}

.task-card {
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.2rem;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
}

.task-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.task-card.task-status-pendente {
    border-left: 5px solid #ffc107;
    background-color: #fff3cd;
}

.task-card.task-status-em-andamento {
    border-left: 5px solid #0dcaf0;
    background-color: #cff4fc;
}

.task-card.task-status-concluida {
    border-left: 5px solid #28a745;
    background-color: #d4edda;
    opacity: 0.95;
}

.task-card.tarefa-atrasada {
    border: 2px solid #dc3545;
    background-color: #f8d7da;
}

.task-card.tarefa-atrasada h5{
    color: #dc3545;
}

.task-card .btn-warning,
.task-card .btn-danger {
    border: none;
    border-radius: 1rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    box-shadow: none;
    background-color: transparent;
    color: #495057;
    transition: all 0.2s ease-in-out;
}

.task-card .btn-warning:hover {
    color: #ffc107;
    background-color: rgba(225, 193, 7, 0.1);
}

.task-card .btn-danger:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.task-title {
    font-weight: 500;
    font-size: 1.05rem;
    color: #343a40;
    letter-spacing: 0.2px;
}

.task-card i.bi-check-circle-fill {
    vertical-align: middle;
}

.form-control,
.form-select {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    border-color: #86b7fe;
}

.border.rounded.shadow-sm.p-3.bg-white {
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease-in-out;
}

.border.rounded.shadow-sm.p-3.bg-white:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

input#category,
input#tags {
    background-color: #f8f9fa;
    color: #6c757d;
    font-style: italic;
}

input#category::placeholder,
input#tags::placeholder {
  color: #adb5bd; 
}

#export-tasks {
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
    color: #0d6efd;
    border-color: #b6d4fe;
}

#export-tasks:hover {
    background-color: #b6d4fe;
    color: #0d6efd;
    border-color: #b6d4fe;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-right: none;
    background-color: #fff;
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.input-group > .tags-container + .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    background-color: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.tag-pill .tag-remove-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    margin-left: 6px;
    padding: 0;
    line-height: 1;
    font-size: 1rem;
}

.tag-pill .tag-remove-btn:hover {
    color: #dc3545;
}

.task-meta-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.task-category-badge, .task-tag-badge {
    padding: 3px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.task-category-badge {
    background-color: #0d6efd;
    color: #fff;
}

.task-tag-badge {
    background-color: #6c757d;
    color: #fff;
}

body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode,
body.dark-mode .bg-light,
body.dark-mode .bg-white {
    background-color: #121212 !important;
    color: #e0e0e0;
}

body.dark-mode .card,
body.dark-mode .task-card,
body.dark-mode .form-wrapper,
body.dark-mode #task-list,
body.dark-mode .modal-content,
body.dark-mode .shadow-sm {
    background-color: #1e1e1e !important;
    color: #e0e0e0;
    border-color: #2c2c2c;
    box-shadow: none !important;
}

body.dark-mode .border,
body.dark-mode .border-start {
    border-color: #444 !important;
}

body.dark-mode h2,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode label,
body.dark-mode p,
body.dark-mode .form-label {
    color: #f0f0f0;
}

body.dark-mode .card h5 {
    color: #ffffff;
}

body.dark-mode .text-muted {
    color: #bbb !important;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #2a2a2a;
    color: #fff;
    border: 1px solid #444;
}

body.dark-mode .form-control::placeholder,
body.dark-mode input::placeholder {
    color: #ccc !important;
    font-style: italic;
}

body.dark-mode .input-group-text {
    background-color: #333;
    color: #ccc;
}

body.dark-mode .btn-primary {
    background: linear-gradient(90deg, #0d6efd, #0a58ca);
    border: none;
}

body.dark-mode .btn-outline-danger {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

body.dark-mode .btn-outline-danger:hover {
    background-color: #ff6b6b;
    color: #fff;
}

body.dark-mode .btn-outline-secondary {
    color: #ccc;
    border-color: #666;
}

body.dark-mode .btn-outline-secondary:hover {
    background-color: #666;
    color: #fff;
}


body.dark-mode .task-card.task-status-pendente {
    background-color: rgba(255, 193, 7, 0.15) !important;
    border-left: 5px solid #ffc107 !important;
}

body.dark-mode .task-card.task-status-em-andamento {
    background-color: rgba(13, 202, 240, 0.15) !important;
    border-left: 5px solid #0dcaf0 !important;
}

body.dark-mode .task-card.task-status-concluida {
    background-color: rgba(40, 167, 69, 0.15) !important;
    border-left: 5px solid #28a745 !important;
}

body.dark-mode .task-card.tarefa-atrasada {
    background-color: rgba(220, 53, 69, 0.15) !important;
    border-left: 5px solid #dc3545 !important;
}

body.dark-mode .task-card span {
    color: #ddd;
}

body.dark-mode .task-card:hover {
    background-color: #2a2a2a;
    transition: background-color 0.3s ease;
}

body.dark-mode ::-webkit-scrollbar {
    width: 8px;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #1e1e1e;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 4px;
}

body.dark-mode .progress {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .progress-bar {
    background-color: #0d6efd !important;
}

body.dark-mode input::placeholder {
    color: #ccc !important;
    font-style: italic;
}

body.dark-mode input[type="text"]:not(:focus):placeholder-shown,
body.dark-mode input[type="email"]:not(:focus):placeholder-shown {
    background-color: #1f1f1f !important;
    color: #e0e0e0;
}

body.dark-mode .tags-container {
    background-color: #2a2a2a;
    border-color: #444;
}

body.dark-mode .tag-pill {
    background-color: #3e3e3e;
    color: #e0e0e0;
}

body.dark-mode .tag-pill .tag-remove-btn {
    color: #aaa;
}

body.dark-mode .tag-pill .tag-remove-btn:hover {
    color: #ff6b6b;
}

body.dark-mode .task-category-badge {
    background-color: #4a8ff7;
}

body.dark-mode .task-tag-badge {
    background-color: #5a6268;
}

@media (max-width: 767.98px) {
    main.container {
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    #login-container .row > .col-md-6 { 
        width: 100%; 
        flex: 0 0 100%;
    }

    #login-image {
        height: 150px;
        max-height: 150px; 
        border-radius: var(--bs-card-border-radius) var(--bs-card-border-radius) 0 0;
    }

    #login-container .col-md-6:last-child .card-body,
    #register-container .card-body { 
        border-radius: 0 0 var(--bs-card-border-radius) var(--bs-card-border-radius);
        padding: 1.5rem;
    }

    #login-container,
    #register-container {
        max-width: 95%; 
        margin-top: 1.5rem; 
    }

    #main-panel h4.mt-2.mb-0 {
        font-size: 1.5rem;
    }
    
    #main-panel h5 {
        font-size: 1.15rem;
        text-align: center;
    }

    #main-panel .row > .col-lg-5,
    #main-panel .row > .col-lg-7 {
        margin-bottom: 1.5rem;
    }

    #main-panel .row.g-3 > [class*="col-"]:not(:last-child) {
        margin-bottom: 0.75rem;
    }

    .border.rounded.shadow-sm.p-3.bg-white {
        padding: 1.25rem;
    }
    
    .task-card {
        padding: 1rem;
    }

    .task-title {
        font-size: 1rem;
    }

    #task-list {
        min-height: auto;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    #login-container {
        max-width: 720px; 
    }
    #login-container .card-body,
    #register-container .card-body {
        padding: 2rem; 
    }
     #main-panel .row > .col-lg-5 { 
        margin-bottom: 2rem;
    }
}

@media (min-width: 992px) {
    #login-image {
        height: 100%; 
        border-top-left-radius: var(--bs-card-border-radius);
        border-bottom-left-radius: var(--bs-card-border-radius);
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    #login-container .col-md-6:last-child .card-body { 
        height: 100%; 
        display: flex;
        flex-direction: column;
        justify-content: center; 
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        border-top-right-radius: var(--bs-card-border-radius);
        border-bottom-right-radius: var(--bs-card-border-radius);
    }
}

body.dark-mode #login-image {
    filter: invert(1) hue-rotate(180deg) brightness(1.2) contrast(0.9);
}

#logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 80px;
    text-align: center;
  }
  
  .logo-img {
    width: 52px;
    height: auto;
    margin-bottom: 2px; 
  }
  
  .app-title {
    font-family: 'Segoe UI', sans-serif;
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1;
    transition: color 0.3s ease;
    color: #212529;
  }
  
  body.dark-mode .app-title {
    color: #ffffff;
  }
  
  @media (max-width: 576px) {
    .logo-img {
      width: 72px;
    }
  
    .app-title {
      font-size: 1.5rem;
    }
  }

  #main-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
  }

  body.dark-mode #dueDate,
  body.dark-mode #edit-dueDate {
    background-color: #1e1e1e !important;
    color: #f8f9fa !important;
    border: 1px solid #6c757d !important;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
  }

  body:not(.dark-mode) #dueDate,
  body:not(.dark-mode) #edit-dueDate {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
  }


  #clear-completed-btn {
    border: none;
    border-radius: 6px;
    font-weight: 500;
    padding: 6px 12px;
    transition: background-color 0.3s ease, color 0.3s ease;
  }
  
  body:not(.dark) #clear-completed-btn {
    background-color: #f8d7da;  
    color: #6e2a2a;             
    border: 1px solid #e6bfc2;
  }
  
  body:not(.dark) #clear-completed-btn:hover {
    background-color: #f4c2c7;
    color: #5a1e1e;
  }
  
  body.dark #clear-completed-btn {
    background-color: #1c0606 !important; 
    color: #f8d7da !important;             
    border: 1px solid #3d1212 !important;
  }
  
  body.dark #clear-completed-btn:hover {
    background-color: #300909 !important;
    color: #fce7e9 !important;
    border-color: #4e1b1b !important;
  }


  .star-btn {
    background-color: transparent !important;
    border: none !important;
    padding: 0.4rem;
  }

  .star-btn .bi-star {
    color: #ffc107;
    font-size: 1.1rem;
  }

  .star-btn .bi-star-fill {
    color: #ffc107;
    font-size: 1.1rem;
  }

  .star-btn:hover .bi-star,
  .star-btn:hover .bi-star-fill {
    transform: scale(1.2);
    transition: transform 0.2 ease;
  }
  
  