:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #ecf0f1;
    --text-color: #34495e;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 60px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.logo-title {
    display: flex;
    align-items: center;
}

.logo {
    width: 40px;
    height: auto;
    margin-right: 10px;
}

h1 {
    font-size: 1.5rem;
    margin: 0;
}

.subtitle {
    font-size: 0.9rem;
    margin: 0;
    text-align: center;
    font-style: italic;
    opacity: 0.8;
}

.language-dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: transparent;
    color: white;
    padding: 10px;
    font-size: 16px;
    border: none;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    max-height: 60vh;
    overflow-y: auto;
    top: 100%;
}

.dropdown-content button {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background-color: transparent;
    cursor: pointer;
    white-space: nowrap;
}

.dropdown-content button:hover {
    background-color: #f1f1f1;
}

.language-dropdown:hover .dropdown-content {
    display: block;
}

.lang-btn img {
    width: 20px;
    height: auto;
    margin-right: 10px;
    vertical-align: middle;
}

.dropdown-content::-webkit-scrollbar {
    width: 5px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: #888;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@media screen and (max-height: 600px) {
    .dropdown-content {
        max-height: 50vh;
    }
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.task-form-container {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    text-align: center;
}

.task-form-container h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.task-form-container p {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.full-width {
    width: 100%;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .input-group {
    flex: 1;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
    width: 100%;
}

.input-group label {
    position: absolute;
    top: -0.5rem;
    left: 0.8rem;
    background-color: white;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
    max-width: calc(100% - 1.6rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

input, select {
    width: 100%;
    box-sizing: border-box;
}

input {
    padding: 1rem 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

input:focus + label {
    color: var(--secondary-color);
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem 2.5rem 1rem 0.8rem;
    font-size: 1rem;
    color: var(--text-color);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%233498db' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    transition: all 0.3s ease;
    width: 100%;
}

select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

select::-ms-expand {
    display: none;
}

.input-group select {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.input-group label {
    z-index: 1;
    top: -0.5rem;
    left: 0.8rem;
    background-color: white;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
}

select:focus + label {
    color: var(--secondary-color);
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    background-color: #f0f0f0;
}

.quadrant {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    padding: 10px;
    transition: all 0.3s ease;
    position: relative;
    min-height: 300px;
    width: 95%;
    display: flex;
    flex-direction: column;
}

.quadrant:hover {
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.quadrant h2 {
    color: #333333;
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}


.quadrant h2 i {
    margin-right: 10px;
}

.quadrant ul {
    list-style-type: none;
    padding: 0;
    min-height: 50px;
    flex: 1;
    width: 100%;
}

.quadrant li {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    transition: background-color 0.2s ease;
    cursor: move;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quadrant li:last-child {
    margin-bottom: 0;
}

.quadrant li:hover {
    background-color: #e9ecef;
}

.task-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.task-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.task-text {
    white-space: wrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.task-deadline {
    white-space: nowrap;
    padding-left: 10px;
    padding-right: 10px;
    z-index: 1;
    position: relative;
    
}

.task-buttons {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.drag-handle {
    cursor: move;
    margin-right: 10px;
    color: #6c757d;
}

.task-buttons button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.task-buttons button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.task-buttons button i {
    margin-right: 5px;
}

#urgentImportant {
    border-top: 4px solid #e74c3c;
}

#notUrgentImportant {
    border-top: 4px solid #3498db;
}

#urgentNotImportant {
    border-top: 4px solid #f39c12;
}

#notUrgentNotImportant {
    border-top: 4px solid #2ecc71;
}

.drag-over {
    border: 2px dashed #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

.empty-drop-area {
    border: 2px dashed #cccccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #555555;
    font-style: italic;
    background-color: #ffffff;
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 60px);
    max-width: 300px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.empty-drop-area:hover {
    transform: translateX(-50%) scale(1.05);
}

.quadrant ul:empty + .empty-drop-area {
    display: block;
}

.quadrant ul:not(:empty) + .empty-drop-area {
    display: none;
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    main {
        padding: 0 1rem;
    }
    
    .quadrant {
        margin-bottom: 1rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .input-group {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 5% auto;
        padding: 1rem;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .input-group {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-buttons button {
        width: 100%;
    }
    
    li {
        flex-direction: column;
        align-items: flex-start;
    }
    
    li button {
        margin-top: 0.5rem;
        margin-left: 0;
    }
    
    .deadline {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .input-group.full-width {
        width: 100%;
    }

    .input-group input,
    .input-group select {
        width: 100%;
        box-sizing: border-box;
    }

    .input-group label {
        width: auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    li {
        grid-template-areas:
            "deadline deadline"
            "task task"
            "buttons buttons";
        grid-template-columns: 1fr;
    }

    .task-buttons {
        justify-content: flex-start;
        margin-top: 0.5rem;
    }

    li button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    li button span {
        display: none;
    }

    li button {
        padding: 8px;
        font-size: 1rem;
    }

    li button i {
        margin: 0;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem 0;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    .task-form-container {
        padding: 1rem;
    }
    
    .quadrant h2 {
        font-size: 1.2rem;
    }
    
    .add-task-button {
        padding: 0.8rem 1rem;
    }
    
    #languageSelector {
        top: 5px;
        right: 5px;
    }
    
    .lang-btn img {
        width: 20px;
        height: 13px;
    }
    
    .modal-content {
        padding: 0.5rem;
    }

    .modal-content h2 {
        font-size: 1.2rem;
    }

    .input-group label {
        font-size: 0.9rem;
    }

    input, select {
        font-size: 0.9rem;
        padding: 0.8rem 0.6rem;
    }

    .modal-buttons button {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .add-task-button {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
        max-width: 180px;
    }
}

footer {
    text-align: center;
    padding: 1rem 0;
    background-color: var(--primary-color);
    color: white;
}

button[type="submit"] {
    background: linear-gradient(90deg, #3498db, #2c3e50);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

button[type="submit"]:hover {
    background: linear-gradient(90deg, #2980b9, #1c3f5a);
}

button[type="submit"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.5);
}

button[type="submit"] i {
    margin-right: 0.5rem;
}

li[draggable="true"] {
    cursor: move;
}

li[draggable="true"]:hover {
    opacity: 0.7;
}

li.drag-over {
    border: 2px dashed var(--secondary-color);
}

.add-task-button {
    background: linear-gradient(90deg, #3498db, #2c3e50);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 200px;
    margin: 1rem auto;
}

.add-task-button:hover {
    background: linear-gradient(90deg, #2980b9, #1c6691);
}

.add-task-button i {
    margin-right: 0.5rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    box-sizing: border-box;
}

.modal-content h2 {
    margin-top: 0;
    color: var(--primary-color);
}

.modal-content p {
    margin-bottom: 1.5rem;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-buttons button {
    background: linear-gradient(90deg, #3498db, #2c3e50);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.modal-buttons button[type="submit"] {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.modal-buttons button[type="button"] {
    background: linear-gradient(90deg, #bdc3c7, #95a5a6);
}

.modal-buttons button:hover {
    background: linear-gradient(90deg, #2980b9, #1c3f5a);
}

.modal-buttons button[type="submit"]:hover {
    background: linear-gradient(90deg, #c0392b, #a93226);
}

.modal-buttons button[type="button"]:hover {
    background: linear-gradient(90deg, #95a5a6, #7f8c8d);
}

.modal-buttons button i {
    margin-right: 0.5rem;
}

/* Dodaj style dla quickAddButton i quickAddDescription */
#quickAddButton {
    background: linear-gradient(90deg, #3498db, #2980b9); /* Niebieski gradient dla przycisku Dodaj zadanie */
    color: white;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 200px;
    margin: 1rem auto;
}

#quickAddButton:hover {
    background: linear-gradient(90deg, #2980b9, #1c6691); /* Ciemniejszy niebieski na hover */
}

#quickAddDescription {
    color: #7f8c8d;
    margin-bottom: 1rem;
    text-align: center;
}

/* Wspólne style dla przycisków w modalu */
.modal-buttons button {
    padding: 0.75rem 1.5rem; /* Ustalona wysokość */
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%; /* Ustalona szerokość */
    max-width: 200px; /* Maksymalna szerokość */
    margin: 1rem auto; /* Wyśrodkowanie */
}

/* Styl dla przycisku Dodaj zadanie */
#addTaskModal .add-task-button {
    background: linear-gradient(90deg, #3498db, #2980b9); /* Niebieski gradient */
    color: white;
}

#addTaskModal .add-task-button:hover {
    background: linear-gradient(90deg, #2980b9, #1c6691); /* Ciemniejszy niebieski na hover */
}

/* Styl dla przycisku Anuluj */
#cancelAddTask {
    background: linear-gradient(90deg, #bdc3c7, #95a5a6); /* Szary gradient */
    color: white;
}

#cancelAddTask:hover {
    background: linear-gradient(90deg, #95a5a6, #7f8c8d); /* Ciemniejszy szary na hover */
}

.task-item {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.task-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f8f9fa;
    position: relative;
}

.task-content {
    flex: 1;
    display: flex;
    align-items: center;
    margin-right: 80px; /* Miejsce na deadline */
}

.task-text {
    margin-left: 10px;
    font-size: 14px;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.task-info {
    position: absolute;
    top: -5px;
    right: 15px;
    font-size: 12px;
    color: #6c757d;
}

.task-buttons {
    display: flex;
    align-items: center;
}

.task-buttons button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 5px;
    color: #6c757d;
    transition: color 0.2s;
}

.task-buttons button:hover {
    color: #495057;
}

.done-btn {
    background-color: #28a745;
}

.remove-btn {
    background-color: #dc3545;
}

.task-buttons button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.task-buttons button i {
    margin-right: 5px;
}

.expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    padding: 5px;
}

.task-details {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 12px;
}

.done {
    text-decoration: line-through;
    color: #6c757d;
}

.overdue {
    color: #dc3545;
    font-weight: bold;
}

@media (max-width: 768px) {
    .task-main {
        flex-wrap: wrap;
    }

    .task-content {
        width: 100%;
        margin-bottom: 10px;
    }

    .task-buttons {
        width: 100%;
        justify-content: flex-end;
    }
}