* {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

body {
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #1c2526, #2c3e50);
    color: #e0e0e0;
}

.container {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

body.dark-mode .container {
    background: none;
}

.todo-app, .right-panel {
    width: 45%;
    background: #ffffff;
    padding: 30px 25px 50px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.dark-mode .todo-app, body.dark-mode .right-panel {
    background: #2c3e50;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.todo-app h2, .right-panel h2 {
    color: #1e3c72;
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 600;
}

body.dark-mode .todo-app h2, body.dark-mode .right-panel h2 {
    color: #64b5f6;
}

.todo-app h2 img, .right-panel h2 img {
    width: 35px;
    margin-left: 15px;
}

#theme-toggle {
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#theme-toggle:hover {
    transform: scale(1.2);
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f4f4f9;
    border-radius: 50px;
    padding: 10px 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

body.dark-mode .row {
    background: #37474f;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#task-count {
    font-size: 14px;
    color: #555;
}

body.dark-mode #task-count {
    color: #b0bec5;
}

input, select, .edit-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 12px;
    font-size: 16px;
    color: #333;
    margin-right: 10px;
}

body.dark-mode input, body.dark-mode select, body.dark-mode .edit-input {
    color: #e0e0e0;
}

.edit-input {
    width: calc(100% - 110px);
    padding: 12px 8px 12px 50px;
    font-size: 16px;
}

select {
    max-width: 120px;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    transition: border-color 0.3s ease;
}

body.dark-mode select {
    background: #455a64;
    border-color: #546e7a;
}

select:focus {
    border-color: #ff4b2b;
}

input::placeholder {
    color: #999;
}

body.dark-mode input::placeholder {
    color: #90a4ae;
}

button {
    border: none;
    outline: none;
    padding: 8px 15px;
    background: #ff4b2b;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 20px;
    transition: background 0.3s ease, transform 0.2s ease;
    margin: 5px;
}

button:hover {
    background: #e43a1a;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

ul li {
    list-style: none;
    font-size: 16px;
    padding: 12px 8px 12px 50px;
    user-select: none;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease;
    text-decoration: line-through;
}

ul li:hover {
    background: #f9f9f9;
}

body.dark-mode ul li:hover {
    background: #37474f;
}

ul li.task-enter {
    animation: slideIn 0.3s ease;
}

ul li.task-exit {
    animation: slideOut 0.3s ease;
}

ul li::before {
    content: '';
    position: absolute;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background-image: url(images/unchecked.png);
    background-size: cover;
    background-position: center;
    top: 14px;
    left: 12px;
}

ul li.checked::before {
    background-image: url(images/checked.png);
}

ul li span.delete-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    font-size: 20px;
    color: #666;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
}

body.dark-mode ul li span.delete-btn {
    color: #b0bec5;
}

ul li span.delete-btn:hover {
    background: #ff4b2b;
    color: #ffffff;
}

ul li[data-priority="high"]::after {
    content: 'High';
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: #d32f2f;
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

ul li[data-priority="medium"]::after {
    content: 'Medium';
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: #f57c00;
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

ul li[data-priority="low"]::after {
    content: 'Low';
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: #2e7d32;
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

ul li[data-priority]:hover::after {
    transform: translateY(-50%) scale(1.05);
}

ul li .task-text {
    display: inline-block;
    max-width: calc(100% - 110px);
}

.note-input-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

#note-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    margin-right: 5px;
    background: #ffffff;
}

body.dark-mode #note-input {
    background: #455a64;
    border-color: #546e7a;
    color: #e0e0e0;
}

#note-input::placeholder {
    color: #999;
}

body.dark-mode #note-input::placeholder {
    color: #90a4ae;
}

#note-output {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
}

body.dark-mode #note-output {
    background: #37474f;
    color: #e0e0e0;
}

.note-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.note-item .delete-btn {
    width: 18px;
    height: 18px;
    font-size: 14px;
    color: #666;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

body.dark-mode .note-item .delete-btn {
    color: #b0bec5;
}

.note-item .delete-btn:hover {
    background: #ff4b2b;
    color: #ffffff;
}

.box {
    background: #ffffff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

body.dark-mode .box {
    background: #2c3e50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.box:hover {
    transform: translateY(-5px);
}

h3 {
    font-size: 18px;
    color: #1e3c72;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

body.dark-mode h3 {
    color: #64b5f6;
}

h3::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 5px;
}

h4 {
    font-size: 16px;
    color: #1e3c72;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

body.dark-mode h4 {
    color: #64b5f6;
}

h4::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 5px;
}

.time-display {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1e3c72;
    transition: all 0.5s ease;
}

body.dark-mode .time-display {
    color: #64b5f6;
}

.time-display.falling {
    animation: fallDown 1s ease-out;
}

#timer-input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 10px;
    width: 80px;
    background: #ffffff;
}

body.dark-mode #timer-input {
    background: #455a64;
    border-color: #546e7a;
    color: #e0e0e0;
}

#timer-input::placeholder {
    color: #999;
}

body.dark-mode #timer-input::placeholder {
    color: #90a4ae;
}

.time-tool-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stopwatch-section, .timer-section, .local-time-section {
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
}

body.dark-mode .stopwatch-section, body.dark-mode .timer-section, body.dark-mode .local-time-section {
    background: rgba(44, 62, 80, 0.9);
}

.footer {
    width: 100%;
    background: #ffffff;
    padding: 20px;
    margin-top: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

body.dark-mode .footer {
    background: #2c3e50;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.footer-content {
    font-size: 14px;
    color: #1e3c72;
}

body.dark-mode .footer-content {
    color: #b0bec5;
}

.footer-content p {
    margin: 5px 0;
}

.footer-content a {
    color: #ff4b2b;
    text-decoration: none;
    transition: color 0.3s ease;
}

body.dark-mode .footer-content a {
    color: #64b5f6;
}

.footer-content a:hover {
    color: #e43a1a;
    text-decoration: underline;
}

body.dark-mode .footer-content a:hover {
    color: #42a5f5;
}

@keyframes fallDown {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes numberChange {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.time-display span {
    display: inline-block;
    animation: numberChange 0.5s ease-in-out;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 10px;
    }

    .todo-app, .right-panel {
        width: 100%;
        margin-bottom: 20px;
        padding: 15px;
    }

    .header-row {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 15px;
    }

    .todo-app h2, .right-panel h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .todo-app h2 img, .right-panel h2 img {
        width: 25px;
        margin-left: 10px;
    }

    #theme-toggle {
        margin-top: 5px;
    }

    .row {
        flex-direction: column;
        padding: 10px;
        margin-bottom: 10px;
    }

    #input-box, #priority-box {
        width: 100%;
        margin-bottom: 10px;
    }

    #priority-box {
        max-width: 100%;
        margin-right: 0;
    }

    button {
        width: 100%;
        margin: 5px 0;
    }

    .controls-row {
        flex-direction: column;
        align-items: flex-start;
    }

    #task-count {
        margin-bottom: 10px;
    }

    .note-input-row {
        flex-direction: column;
        gap: 10px;
    }

    #note-input {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .time-tool-section {
        flex-direction: column;
        gap: 10px;
    }

    .stopwatch-section, .timer-section, .local-time-section {
        padding: 10px;
    }

    .time-display {
        font-size: 18px;
    }

    #timer-input {
        width: 100%;
    }

    button {
        padding: 10px;
        font-size: 14px;
    }

    .footer {
        padding: 15px;
        margin-top: 15px;
    }

    .footer-content {
        font-size: 12px;
    }
}