/**
 * 🎨 Bienvenue dans le CSS (Cascading Style Sheets) !
 * 
 * Si le HTML est le squelette, le CSS est les vêtements et les couleurs !
 * C'est ici qu'on décide du look de l'application.
 */

body {
    background-color: #1a1a1a;
    color: white;
    font-family: sans-serif;
    padding: 20px;
    margin: 0;
}

.container {
    display: flex;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.main-column {
    flex: 2;
}

.completed-column {
    flex: 1;
    background-color: #222;
    padding: 20px;
    border-radius: 10px;
    min-width: 300px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
}

#taskCounter {
    position: absolute;
    left: 0;
    font-size: 1.2em;
    color: #4CAF50;
}

h1, h2 {
    text-align: center;
}

h2 {
    margin-top: 0;
    color: #4CAF50;
}

#taskInput, #detailsInput {
    background-color: #333;
    color: white;
    border: 1px solid #cccccc;
    padding: 12px;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}

#taskInput {
    flex: 1;
}

.add-task {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.add-details {
    margin-bottom: 20px;
    display: none;
}

.add-details.visible {
    display: block;
    animation: fadeIn 0.2s ease-in;
}

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

.toggle-details-btn, .toggle-date-btn {
    background: transparent;
    color: #888;
    border: 1px dashed #555;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 0.9em;
    margin-bottom: 10px;
    margin-top: 10px;
    transition: all 0.2s;
}

.toggle-details-btn:hover, .toggle-date-btn:hover {
    color: #4CAF50;
    border-color: #4CAF50;
}

.toggle-date-btn {
    font-size: 0.85em;
    padding: 6px 10px;
}

.date-inputs {
    display: none;
    gap: 10px;
    margin-top: 10px;
}

.date-inputs.visible {
    display: flex;
}

.date-field, .time-field {
    background-color: #333;
    color: white;
    border: 1px solid #555;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

.date-field:focus, .time-field:focus {
    outline: none;
    border-color: #4CAF50;
}

.date-field {
    flex: 1;
    max-width: 150px;
}

.time-field {
    width: 100px;
}

.recurrence-select {
    background-color: #333;
    color: white;
    border: 1px solid #555;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.recurrence-select:focus {
    outline: none;
    border-color: #4CAF50;
}

.task-recurrence {
    font-size: 0.75em;
    color: #ff9800;
    background-color: rgba(255, 152, 0, 0.15);
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
}

.task.recurring {
    border-left: 3px solid #ff9800;
}

.task.completed.recurring {
    border-left-color: #ff9800;
}

#addBtn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 20px;
    font-weight: bold;
}

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

.task {
    background-color: #333;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    border-radius: 8px;
    min-height: 80px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.task:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.task.completed {
    opacity: 0.6;
    background-color: #2a4a2a;
}

.task.overdue {
    border-left: 3px solid #ff6b6b;
}

.task-title {
    font-weight: bold;
    word-break: break-word;
}

.task-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.task-details-preview {
    font-size: 0.85em;
    color: #aaa;
    font-style: italic;
    word-break: break-word;
}

.task-due-date {
    font-size: 0.75em;
    color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.15);
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
}

.task-due-date.overdue {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.15);
}

.task-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.details-indicator {
    font-size: 0.75em;
    color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.15);
    padding: 3px 8px;
    border-radius: 10px;
}

.details-indicator.has-no-details {
    color: #666;
    background-color: rgba(100, 100, 100, 0.2);
}

.details-btn {
    background: transparent;
    color: #4CAF50;
    border: 1px solid #4CAF50;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    transition: all 0.2s;
}

.details-btn:hover {
    background-color: rgba(76, 175, 80, 0.2);
}

.deleteBtn {
    background: transparent;
    color: #ff6b6b;
    border: none;
    cursor: pointer;
    font-size: 1.3em;
    border-radius: 4px;
    padding: 5px 10px;
}

.deleteBtn:hover {
    background-color: rgba(255, 107, 107, 0.2);
}

.completed-column .task {
    background-color: #2a4a2a;
}

#clearAllBtn {
    background-color: #ff6b6b;
    color: white;
    padding: 12px 20px;
    border: none;
    cursor: pointer;
    margin-top: 20px;
    border-radius: 5px;
    width: 100%;
    font-size: 14px;
}

.import-export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.import-export-btn {
    flex: 1;
    background-color: #444;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    text-align: center;
    transition: background-color 0.2s;
}

.import-export-btn:hover {
    background-color: #555;
}

.import-label {
    display: inline-block;
}

.import-label:hover {
    background-color: #555;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.visible {
    display: flex;
    animation: fadeIn 0.2s ease-in;
}

.modal {
    background-color: #2a2a2a;
    padding: 25px;
    border-radius: 10px;
    max-width: 450px;
    width: 90%;
}

.modal h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: white;
}

.modal textarea {
    width: 100%;
    height: 100px;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 10px;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.modal textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    border: none;
}

.modal-btn.cancel {
    background-color: #555;
    color: white;
}

.modal-btn.save {
    background-color: #4CAF50;
    color: white;
}

.welcome-modal {
    max-width: 500px;
}

.welcome-modal h3 {
    color: #4a90d9;
    font-size: 1.4em;
}

.welcome-content {
    color: #ccc;
    line-height: 1.6;
}

.welcome-content p {
    margin-bottom: 15px;
}

.welcome-section {
    background-color: #333;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.welcome-section h4 {
    margin: 0 0 10px 0;
    color: #4CAF50;
    font-size: 1em;
}

.welcome-section ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.welcome-section li {
    margin-bottom: 8px;
}

.welcome-tip {
    background-color: rgba(74, 144, 217, 0.15);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #4a90d9;
    font-size: 0.95em;
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }
    
    .completed-column {
        min-width: auto;
    }
}

.install-prompt-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.install-prompt {
    background-color: #2a2a2a;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.install-prompt p {
    margin: 0 0 12px 0;
    color: white;
    font-size: 14px;
}

.install-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.install-btn {
    background-color: #4CAF50;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.install-btn:hover {
    background-color: #45a049;
}

.dismiss-btn {
    background-color: #444;
    color: #aaa;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.dismiss-btn:hover {
    background-color: #555;
    color: white;
}
