/* General Page Styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;        /* Horizontal center */
    align-items: flex-start;        /* Top-aligned */
    min-height: 100vh;
}

/* Container to wrap content */
.container {
    background-color: #fff;
    padding: 30px;
    margin: 40px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 800px;
}

/* Headings */
h2 {
    color: #222;
    margin-bottom: 20px;
    text-align: center;
}

/* Form Styling */
form {
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

input[type="text"],
input[type="date"],
button {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

input[type="text"]:focus,
input[type="date"]:focus {
    border-color: #007BFF;
    outline: none;
}

/* Buttons */
button {
    background-color: #007BFF;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

/* Top Bar Styling */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.top-bar h2 {
    margin: 0;
}

.button {
    padding: 10px 16px;
    background-color: #28a745;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.button:hover {
    background-color: #218838;
}

/* Link buttons inside table */
.link-button {
    padding: 6px 12px;
    margin: 0 4px;
    border-radius: 4px;
    text-decoration: none;
    color: white;
    font-size: 0.9em;
}

.link-button.edit {
    background-color: #007BFF;
}

.link-button.edit:hover {
    background-color: #0056b3;
}

.link-button.delete {
    background-color: #dc3545;
}

.link-button.delete:hover {
    background-color: #c82333;
}

/* Links */
a {
    color: #007BFF;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Error Message */
.error {
    color: red;
    margin-top: -10px;
    margin-bottom: 10px;
    text-align: center;
}

/* Task Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f1f1f1;
    color: #333;
}

tr:hover {
    background-color: #f9f9f9;
}

tr {
    transition: opacity 0.5s ease;
}

/* Responsive Table on Small Screens */
@media (max-width: 600px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }

    tr {
        margin-bottom: 15px;
    }

    td {
        padding-left: 50%;
        position: relative;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 15px;
        font-weight: bold;
        white-space: nowrap;
    }

    th {
        display: none;
    }
}
