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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 16px;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    min-height: 80vh;
}

.header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.user-info {
    font-size: 14px;
    opacity: 0.9;
}

.tab-bar {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 14px;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    transition: all 0.3s;
}

.tab.active {
    color: #f5576c;
    border-bottom: 3px solid #f5576c;
    background: white;
}

.content {
    padding: 20px;
    padding-bottom: 80px;
}

/* Кнопка пука */
.fart-button-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    width: calc(100% - 32px);
    z-index: 1000;
}

.fart-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 60px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

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

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

/* Метрики */
.metric {
    margin-bottom: 25px;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.emojis {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 24px;
}

.emoji-level {
    flex: 1;
    text-align: center;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

.emoji-level.selected {
    transform: scale(1.2);
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f5576c;
    cursor: pointer;
}

.metric-value {
    text-align: right;
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}

/* Список записей */
.entries-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.entry-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
    border: 1px solid #e0e0e0;
}

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

.entry-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.entry-metrics {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.metric-badge {
    background: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
}

/* Детали записи */
.detail-container {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
}

.detail-metric {
    margin: 15px 0;
    padding: 12px;
    background: white;
    border-radius: 12px;
}

.back-btn {
    background: #667eea;
    color: white;
    text-decoration: none;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

/* Алерты */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Блок статистики */
.stats-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #f3e7e9 100%);
    border-radius: 20px;
    padding: 15px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stats-averages, .stats-records {
    margin-bottom: 15px;
}

.stat-title {
    font-weight: bold;
    color: #555;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.stat-item {
    background: white;
    padding: 8px 12px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.record-item {
    background: white;
    padding: 8px 12px;
    border-radius: 30px;
    font-size: 13px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.record-item strong {
    color: #f5576c;
    font-size: 12px;
    font-weight: 600;
}

/* Доктор Пуколог */
.doctor-comment {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 16px;
    padding: 15px;
    margin-top: 20px;
    border-left: 4px solid #4caf50;
}

.doctor-header {
    font-size: 18px;
    margin-bottom: 10px;
    color: #2e7d32;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doctor-emoji {
    font-size: 24px;
}

.doctor-text {
    font-size: 14px;
    line-height: 1.5;
    color: #1b5e20;
    font-style: italic;
}

/* Лоадер */
.loader-container {
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.loader {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    font-size: 16px;
    font-weight: bold;
    vertical-align: middle;
}