* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

nav {
    background: #fff;
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
}

nav button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

nav button:hover {
    background: #0056b3;
}

main {
    width: 100%;
    max-width: 800px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 30px;
    min-height: 400px;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    margin-bottom: 20px;
    color: #444;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* To-Do List */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.input-group button, #genColorBtn, #openModal {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.input-group button:hover, #genColorBtn:hover, #openModal:hover {
    background: #218838;
}

.task-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid #eee;
}

.task-item button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.task-item button:hover {
    background: #c82333;
}

#genColorBtn {
    margin-bottom: 20px;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.color-box {
    height: 120px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
#tableContainer table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#tableContainer th, #tableContainer td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: right;
}

#tableContainer th {
    background-color: #f2f2f2;
}

/* Modal */
.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.overlay.active, .modal.active {
    display: block;
}

.modal h3 {
    margin-bottom: 15px;
}

.modal p {
    margin-bottom: 20px;
    color: #666;
}
#closeModal {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
}

#closeModal:hover {
    background: #5a6268;
}
