/* ============================================
   TASKAPP - Design Ultra Simpliste
   Par Fatou - BMZ Team
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg: #000000;
    --card: #111111;
    --accent: #3b82f6;
    --green: #22c55e;
    --yellow: #eab308;
    --text: #ffffff;
    --muted: #666666;
    --border: #222222;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 16px;
}

/* App Container */
.app {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0 30px 0;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
}

.btn-settings {
    width: 50px;
    height: 50px;
    background: var(--card);
    border: none;
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-settings:hover, .btn-settings:active {
    background: var(--border);
    color: var(--text);
}

/* ============================================
   GROS BOUTONS D'ACTION
   ============================================ */

.actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 25px 30px;
    border: none;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-action:active {
    transform: scale(0.98);
}

.btn-note {
    background: var(--yellow);
    color: #000;
}

.btn-task {
    background: var(--green);
    color: #000;
}

.btn-calendar {
    background: var(--accent);
    color: #fff;
}

.btn-icon {
    font-size: 24px;
}

/* ============================================
   BARRE DE RECHERCHE
   ============================================ */

.search-bar {
    margin-bottom: 30px;
}

.search-input {
    width: 100%;
    padding: 18px 25px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 15px;
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--accent);
}

.search-input::placeholder {
    color: var(--muted);
}

/* ============================================
   SECTION AUJOURD'HUI
   ============================================ */

.section-today {
    margin-top: 10px;
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 3px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.today-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================
   ITEMS (Notes & Tâches) - SWIPEABLE
   ============================================ */

.item-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.item-delete-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100px;
    background: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--card);
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.2s ease;
    touch-action: pan-y;
    z-index: 1;
}

.item.swiping {
    transition: none;
}

.item:active {
    background: #1a1a1a;
}

.item-checkbox {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.item-checkbox.checked {
    background: var(--green);
    border-color: var(--green);
}

.item-checkbox.checked::after {
    content: '✓';
    color: #000;
    font-size: 16px;
    font-weight: bold;
}

.item.note .item-checkbox {
    background: var(--yellow);
    border-color: var(--yellow);
    border-radius: 6px;
}

.item.note .item-checkbox::after {
    content: '■';
    color: #000;
    font-size: 12px;
}

.item-content {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item.completed .item-title {
    text-decoration: line-through;
    color: var(--muted);
}

.item-meta {
    font-size: 13px;
    color: var(--muted);
}

.item-time {
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
}

.item-edit {
    width: 40px;
    height: 40px;
    background: var(--border);
    border: none;
    border-radius: 10px;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.item:hover .item-edit {
    opacity: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 10px;
}

.empty-hint {
    font-size: 14px;
    opacity: 0.6;
}

/* ============================================
   MODALS
   ============================================ */

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card);
    border-radius: 25px 25px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.btn-close {
    width: 40px;
    height: 40px;
    background: var(--border);
    border: none;
    border-radius: 50%;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    gap: 15px;
    padding: 20px 25px 35px;
}

/* Form Inputs - GROS */
.input-title {
    width: 100%;
    padding: 20px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 15px;
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.input-title:focus {
    outline: none;
    border-color: var(--accent);
}

.input-content {
    width: 100%;
    padding: 20px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 15px;
    color: var(--text);
    font-size: 16px;
    min-height: 120px;
    resize: none;
}

.input-content:focus {
    outline: none;
    border-color: var(--accent);
}

.task-options {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.input-time, .input-date {
    flex: 1;
    padding: 18px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
}

.input-time:focus, .input-date:focus {
    outline: none;
    border-color: var(--accent);
}

/* Buttons - GROS */
.btn-cancel {
    flex: 1;
    padding: 20px;
    background: var(--border);
    border: none;
    border-radius: 15px;
    color: var(--text);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
}

.btn-save {
    flex: 1;
    padding: 20px;
    background: var(--accent);
    border: none;
    border-radius: 15px;
    color: white;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
}

.btn-save:active, .btn-cancel:active {
    transform: scale(0.98);
}

.btn-delete {
    width: 100%;
    padding: 18px;
    background: transparent;
    border: 2px solid #ef4444;
    border-radius: 15px;
    color: #ef4444;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
}

/* ============================================
   CALENDAR
   ============================================ */

.modal-calendar .modal-content {
    max-width: 400px;
    border-radius: 25px;
    margin: auto;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-month {
    grid-column: span 7;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.calendar-day-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    padding: 10px 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.calendar-day:active {
    background: var(--border);
}

.calendar-day.today {
    background: var(--accent);
    color: white;
    font-weight: 700;
}

.calendar-day.has-items::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 5px;
    height: 5px;
    background: var(--green);
    border-radius: 50%;
}

/* ============================================
   INTEGRATIONS
   ============================================ */

.integrations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.integration-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 25px 15px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.integration-card:active {
    transform: scale(0.98);
}

.integration-card.active {
    border-color: var(--green);
    background: rgba(34, 197, 94, 0.1);
}

.integration-icon {
    font-size: 36px;
}

.integration-name {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.integration-status {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
}

.integration-card.active .integration-status {
    color: var(--green);
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 500px) {
    .app {
        padding: 15px;
    }

    .btn-action {
        padding: 22px 25px;
        font-size: 16px;
    }

    .item {
        padding: 18px;
    }

    .modal-content {
        border-radius: 20px 20px 0 0;
    }
}

/* Safe area for notch phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .app {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }

    .modal-footer {
        padding-bottom: calc(35px + env(safe-area-inset-bottom));
    }
}
