* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.stat-icon {
    font-size: 2.5em;
}

.stat-label {
    font-size: 0.8em;
    opacity: 0.85;
    font-weight: 500;
}

.info-icon {
    font-size: 0.85em;
    opacity: 0.6;
    margin-left: 4px;
}

.cache-tech {
    display: block;
    font-size: 0.45em;
    opacity: 0.5;
    font-weight: 400;
    margin-top: 2px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 600;
}

input, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

button:active {
    transform: translateY(0);
    box-shadow: none;
}

.entries {
    margin-top: 30px;
}

.entry {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.entry:hover {
    transform: translateX(5px);
}

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

.entry-name {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.entry-date {
    color: #999;
    font-size: 0.9em;
}

.entry-message {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
}

.cache-indicator {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 10px;
}

.cache-hit {
    background: #4caf50;
    color: white;
}

.cache-miss {
    background: #ff9800;
    color: white;
}

.loading {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 1.2em;
}

.error {
    background: #f44336;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* новые блоки для UI: сортировка + кнопки редакт/удалить */

.entries-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    margin-bottom: 20px;
}

.entries-header h2 {
    margin: 0;
}

.entries-header select {
    padding: 6px 10px;
    border-radius: 8px;
    border: none;
    font-size: 0.95em;
}

.entry-actions {
    display: flex;
    gap: 8px;
}

.entry-btn {
    background: #f5f5f5;
    color: #333;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.85em;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.entry-btn:hover {
    background: #e7e7ff;
    transform: translateY(-1px);
}

.entry-btn.delete-btn {
    background: #ffe5e5;
    border-color: #ffb3b3;
}

.entry-btn.delete-btn:hover {
    background: #ffcccc;
}

/* СТИКЕРЫ / МОДАЛКА — КАК У ТЕБЯ, БЕЗ ИЗМЕНЕНИЯ РАЗМЕРОВ */

.button-container {
    position: relative;
}

.feedback-image {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 400px;
    height: auto;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    border-radius: 111px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.3s ease;
    pointer-events: none;
    z-index: 2000;
}

.feedback-image.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px 24px 18px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    position: relative;
}

.modal-image {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
    margin: -70px auto 10px;
    border: 4px solid #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    background: #ddd;
}

.modal-text {
    font-size: 15px;
    margin: 8px 0 16px;
    color: #333;
}

.modal-button {
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 8px 22px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.modal-button:hover {
    opacity: 0.9;
}

/* Стили для модальных окон подтверждения и редактирования */
.modal-confirm, .modal-edit {
    max-width: 450px;
    text-align: left;
}

.modal-confirm h3, .modal-edit h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    color: #333;
    text-align: center;
}

.modal-confirm p {
    margin: 0 0 20px 0;
    color: #666;
    text-align: center;
}

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

.modal-button-cancel {
    background: #e0e0e0;
    color: #333;
}

.modal-button-cancel:hover {
    background: #d0d0d0;
}

.modal-button-danger {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
}

.modal-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modal-edit .form-group {
    margin-bottom: 16px;
}

.modal-edit label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.modal-edit input,
.modal-edit textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.modal-edit input:focus,
.modal-edit textarea:focus {
    outline: none;
    border-color: #667eea;
}

.modal-edit textarea {
    min-height: 100px;
    resize: vertical;
}

/* адаптив */

@media (max-width: 768px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .entry-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .entry-actions {
        margin-top: 8px;
    }
}
