/* public/assets/css/style.css */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Убирает серый фон при тапе на iOS */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    color: #212529;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%; /* Запрещает браузеру менять размер текста */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

h1, h2, h3 {
    color: #2c3e50;
    margin-top: 0;
}

/* Кнопки и ссылки-кнопки */
button, input[type="submit"], .button, a.button {
    display: inline-block;
    padding: 14px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    margin: 8px 0;
    transition: all 0.2s ease;
    text-align: center;
}

button:hover, input[type="submit"]:hover, .button:hover, a.button:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Поля ввода — крупные, удобные для телефона */
input, textarea, select {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 18px; /* Ключевое: предотвращает зум на iOS/Android */
    background: #fdfdfd;
    transition: border-color 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}

/* Таблицы — десктоп */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 17px;
    box-shadow: 0 0 5px rgba(0,0,0,0.05);
    border-radius: 10px;
    overflow: hidden;
}

th, td {
    padding: 14px;
    border: 1px solid #e9ecef;
    text-align: left;
    vertical-align: top;
}

th {
    background-color: #f1f3f5;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 15px;
    color: #495057;
}

/* Статусы задач */
.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    display: inline-block;
    min-width: 90px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-badge.ожидает { background: #ffc107; color: #212529; }
.status-badge.в-процессе { background: #17a2b8; }
.status-badge.сделал { background: #28a745; }

/* Модальное окно редактирования */
#editModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    max-width: 95%;
    width: 360px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* Ссылки на действия */
a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

.delete-link {
    color: #dc3545;
    font-weight: 600;
    margin-left: 10px;
}

/* Формы — визуальное выделение */
form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    margin: 25px 0;
    border: 1px solid #e9ecef;
}

form h3 {
    margin-top: 0;
    color: #343a40;
}

/* Адаптивность — мобильные устройства */
@media (max-width: 768px) {

    .container {
        padding: 12px;
    }

    h1 {
        font-size: 26px;
    }

    /* Таблицы → карточки */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border: 1px solid #e9ecef;
        margin-bottom: 20px;
        border-radius: 12px;
        padding: 20px 15px;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }

    td {
        border: none;
        position: relative;
        padding-left: 50% !important;
        padding-top: 16px;
        padding-bottom: 16px;
        text-align: right;
        font-size: 17px;
    }

    td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        top: 16px;
        width: 45%;
        white-space: nowrap;
        font-weight: 700;
        text-align: left;
        color: #495057;
        font-size: 15px;
    }

    /* Статус — крупнее для телефона */
    .status-badge {
        padding: 12px 20px;
        font-size: 17px;
        min-width: 110px;
    }

    /* Действия — делаем блоком */
    td:last-child {
        text-align: left !important;
        padding-top: 25px !important;
        padding-bottom: 5px !important;
    }

    td:last-child:before {
        display: none;
    }

    td:last-child a {
        display: block;
        margin: 8px 0;
        padding: 14px;
        text-align: center;
        border-radius: 8px;
        background: #f1f3f5;
        font-size: 17px;
        font-weight: 600;
    }

    td:last-child a.delete-link {
        background: #ffecec;
        color: #c82333;
    }

    /* Кнопки — на всю ширину */
    button, input[type="submit"] {
        width: 100%;
        font-size: 19px;
        padding: 16px;
        margin: 12px 0;
    }

    /* Модальное окно — адаптируем */
    #editModal {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        margin: 20px;
        border-radius: 16px;
    }

    /* Уменьшаем отступы */
    form {
        padding: 18px;
        margin: 20px 0;
    }
}

/* Очень маленькие экраны — iPhone SE и т.п. */
@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }

    input, textarea, select {
        font-size: 18px;
        padding: 16px;
    }

    button, input[type="submit"] {
        padding: 18px;
        font-size: 19px;
    }

    .status-badge {
        padding: 14px 22px;
        font-size: 18px;
    }

    td {
        font-size: 16px;
    }

    td:before {
        font-size: 14px;
    }
}