/* Global */
* {
    margin: 0;
    padding: 0;
    font-family: "Poppins", sans-serif;
    box-sizing: border-box;
}

body {
    background: #fafafa;
}

/* Layout */
.layout {
    display: flex;
}

/* ========================================
   MOBILE MENU TOGGLE (Hamburger)
   ======================================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: 0.3s;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #ddd;
    padding: 20px;
    z-index: 999;
    transition: transform 0.3s ease;
}

.logo {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.side-btn {
    display: block;
    width: 100%;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    background: #f9f9f9;
    margin-bottom: 10px;
    border-radius: 8px;
    transition: 0.3s;
}

.side-btn:hover {
    background: #efefef;
}

.logout {
    background: #ff3b3b;
    color: white;
}

.logout:hover {
    background: #e22a2a;
}

.side-btn.active {
    background: #222;
    color: white;
}

/* Content */
.content {
    margin-left: 260px;
    padding: 30px;
    width: calc(100% - 260px);
}

.page-title {
    font-size: 30px;
    font-weight: 600;
    margin-bottom: 30px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.stat-card {
    background: #fff;
    padding: 25px;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transition: 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card h2 {
    font-size: 35px;
    margin-bottom: 7px;
}

.stat-card.completed {
    background: #d3ffd6;
}

.stat-card.today {
    background: #fff7d6;
}

/* View Tasks Button */
.view-btn {
    display: inline-block;
    padding: 12px 22px;
    background: #007aff;
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    margin: 20px 0 10px;
    transition: 0.3s;
}

.view-btn:hover {
    background: #005fcc;
}

/* Section Title */
.section-title {
    margin-top: 30px;
    font-size: 24px;
    font-weight: bold;
}

/* Tasks Due Today Section */
.task-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.task-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.task-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.task-head h3 {
    word-break: break-word;
}

.task-desc {
    margin: 10px 0;
    font-size: 14px;
    color: #444;
    word-break: break-word;
}

.tag.overdue {
    background: red;
    color: #fff;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
}

.task-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.edit-btn,
.delete-btn {
    padding: 7px 15px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
}

.edit-btn {
    background: #ffc400;
    color: black;
}

.delete-btn {
    background: red;
    color: white;
}

/* No task message */
.no-tasks {
    font-size: 18px;
    color: #444;
    margin-top: 20px;
}

/* ========================================
   DASHBOARD STATISTICS STYLES
   ======================================== */

/* Checkmark styling for completed tasks */
.checkmark {
    color: #4CAF50;
    font-weight: bold;
    margin-right: 8px;
    font-size: 1.2em;
}

/* Completed task card styling */
.task-card.completed-task {
    opacity: 0.8;
    border-left: 4px solid #4CAF50;
}

.task-card.completed-task h3 {
    color: #4CAF50;
}

/* Completed tag styling */
.tag.completed-tag {
    background: #4CAF50;
    color: white;
}

/* Statistics Container */
.statistics-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* Stat Detail Cards */
.stat-detail-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-detail-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-detail-card.mini {
    padding: 20px;
}

/* Stat Icons */
.stat-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stat-icon-small {
    font-size: 1.8em;
    margin-bottom: 8px;
}

/* Stat Card Headings */
.stat-detail-card h3 {
    color: #333;
    font-size: 1.2em;
    margin: 10px 0;
    font-weight: 600;
}

.stat-detail-card h4 {
    color: #555;
    font-size: 1em;
    margin: 8px 0;
    font-weight: 600;
}

/* Percentage Bar */
.percentage-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.percentage-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 1s ease;
}

.percentage-fill.success {
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
}

.percentage-fill.warning {
    background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%);
}

/* Stat Numbers */
.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    margin: 10px 0 5px 0;
}

.stat-number-small {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    margin: 5px 0;
}

/* Stat Labels */
.stat-label {
    color: #666;
    font-size: 0.95em;
    margin-top: 5px;
}

/* ========================================
   DISPLAY PAGE
   ======================================== */

.display-container {
    padding: 30px;
    margin-left: 260px;
}

.top-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.top-menu h1 {
    font-size: 28px;
}

.buttons-wrap {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.buttons-wrap a {
    padding: 10px 18px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
}

.green-btn {
    background: #2ecc71;
    color: white;
}

.green-btn:hover {
    background: #23a65b;
}

.blue-btn {
    background: #3498db;
    color: white;
}

.blue-btn:hover {
    background: #217bb8;
}

/* FILTER BAR */
.filter-bar {
    margin-top: 25px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 8px 14px;
    background: #eee;
    border-radius: 6px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
}

.filter-btn.active {
    background: #222;
    color: white;
}

.priority-form select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #aaa;
    font-weight: 600;
}

/* TABLE */
.table-container {
    margin-top: 25px;
    overflow-x: auto;
}

.task-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.task-table thead {
    background: #f2f2f2;
}

.task-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.task-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.task-table td[data-label] {
    position: relative;
}

.action-cell {
    white-space: nowrap;
}

/* Status buttons */
.status-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
}

.completed {
    background: #2ecc71;
    color: white;
}

.pending {
    background: #f1c40f;
    color: black;
}

/* Priority */
.priority-badge {
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: white;
    font-weight: bold;
    display: inline-block;
}

.priority-badge.high {
    background: red;
}

.priority-badge.medium {
    background: orange;
}

.priority-badge.low {
    background: green;
}

.empty-msg {
    padding: 20px;
    font-size: 18px;
    color: #444;
}

/* ========================================
   ADD TASK FORM
   ======================================== */

.add-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f7f8fa;
    padding: 20px;
}

.add-box {
    background: #fff;
    width: 100%;
    max-width: 420px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.4s ease-in-out;
}

.add-title {
    text-align: center;
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 20px;
}

.add-box form label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
}

.add-box form input,
.add-box form textarea,
.add-box form select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 6px;
    background: #f1f1f1;
    border: 1px solid #ccc;
    font-size: 15px;
    outline: none;
    transition: 0.3s;
}

.add-box form input:focus,
.add-box form textarea:focus,
.add-box form select:focus {
    border-color: #007aff;
    background: #fff;
}

.add-btn {
    width: 100%;
    margin-top: 22px;
    padding: 12px;
    background: #22c55e;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    color: white;
    font-weight: 700;
    font-size: 16px;
    transition: 0.3s;
}

.add-btn:hover {
    background: #17a349;
}

.back-btn {
    display: block;
    margin-top: 20px;
    text-align: center;
    color: #3498db;
    font-weight: bold;
    text-decoration: none;
}

.back-btn:hover {
    text-decoration: underline;
}

/* Small fade animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   LOGIN/REGISTER FORMS
   ======================================== */

.modern-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8f9fa;
    padding: 20px;
}

.modern-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
}

.modern-card h2 {
    margin-bottom: 20px;
    text-align: center;
    font-size: 26px;
    color: #333;
}

.modern-card label {
    font-size: 15px;
    display: block;
    margin: 8px 0 4px;
    color: #444;
}

.modern-card input[type="text"],
.modern-card input[type="email"],
.modern-card input[type="password"],
.modern-card textarea,
.modern-card select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ccc;
    outline: none;
    margin-bottom: 14px;
    font-size: 15px;
}

.modern-card input:focus,
.modern-card select:focus,
.modern-card textarea:focus {
    border-color: #4C6FFF;
}

.modern-card input[type="submit"] {
    width: 100%;
    padding: 12px;
    border: none;
    background: #4C6FFF;
    color: white;
    border-radius: 8px;
    font-size: 17px;
    cursor: pointer;
    margin-top: 5px;
    transition: 0.3s;
}

.modern-card input[type="submit"]:hover {
    background: #3754d9;
}

.bbut {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: transparent;
    border: 1px solid #4C6FFF;
    color: #4C6FFF;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.bbut:hover {
    background: #4C6FFF;
    color: white;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet */
@media(max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .task-wrapper {
        grid-template-columns: 1fr;
    }

    .statistics-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media(max-width: 768px) {

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Show overlay */
    .sidebar-overlay {
        display: block;
    }

    /* Hide sidebar by default on mobile */
    .sidebar {
        transform: translateX(-100%);
    }

    /* Show sidebar when active */
    .sidebar.active {
        transform: translateX(0);
    }

    /* Adjust content for mobile */
    .content {
        margin-left: 0;
        width: 100%;
        padding: 70px 15px 15px 15px;
    }

    .display-container {
        margin-left: 0;
        padding: 70px 15px 15px 15px;
    }

    /* Page title */
    .page-title {
        font-size: 24px;
    }

    /* Stats grid - single column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-card h2 {
        font-size: 28px;
    }

    /* Statistics container - single column */
    .statistics-container {
        grid-template-columns: 1fr;
    }

    .stat-detail-card {
        padding: 20px;
    }

    .stat-number {
        font-size: 2em;
    }

    .stat-icon {
        font-size: 2em;
    }

    /* Section title */
    .section-title {
        font-size: 20px;
    }

    /* Task wrapper - single column */
    .task-wrapper {
        grid-template-columns: 1fr;
    }

    .task-card {
        padding: 15px;
    }

    .task-head {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Top menu */
    .top-menu {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-menu h1 {
        font-size: 24px;
    }

    .buttons-wrap {
        width: 100%;
    }

    .buttons-wrap a {
        flex: 1;
        text-align: center;
    }

    /* Filter bar */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-btn {
        text-align: center;
    }

    .priority-form {
        width: 100%;
    }

    .priority-form select {
        width: 100%;
    }

    /* View button */
    .view-btn {
        display: block;
        text-align: center;
        width: 100%;
    }

    /* Add box */
    .add-box {
        padding: 25px;
    }

    .add-title {
        font-size: 20px;
    }

    /* Modern card */
    .modern-card {
        padding: 25px;
    }

    .modern-card h2 {
        font-size: 22px;
    }
}

/* Small Mobile */
@media(max-width: 480px) {
    .content {
        padding: 60px 10px 10px 10px;
    }

    .display-container {
        padding: 60px 10px 10px 10px;
    }

    .page-title {
        font-size: 20px;
    }

    .stat-card h2 {
        font-size: 24px;
    }

    .stat-number {
        font-size: 1.8em;
    }

    .task-actions {
        flex-direction: column;
    }

    .edit-btn,
    .delete-btn {
        width: 100%;
        text-align: center;
    }

    /* Mobile Table as Cards */
    .task-table {
        min-width: 100%;
    }

    .task-table thead {
        display: none;
    }

    .task-table tbody,
    .task-table tr {
        display: block;
        width: 100%;
    }

    .task-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: white;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .task-table td {
        display: block;
        text-align: right;
        padding: 10px 15px;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        padding-left: 50%;
    }

    .task-table td:last-child {
        border-bottom: none;
    }

    .task-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        font-weight: bold;
        text-align: left;
        color: #333;
    }

    .task-table td.action-cell {
        text-align: center;
        padding-left: 15px;
    }

    .task-table td.action-cell:before {
        display: none;
    }

    .task-table td.action-cell a {
        margin: 5px;
        display: inline-block;
    }
}