/* public/assets/css/style.css */

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fb;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ============================================
   КОНТЕЙНЕР
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.main-content {
    flex: 1;
    padding: 20px 0;
}

/* ============================================
   КНОПКИ
   ============================================ */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.btn-secondary {
    background: #764ba2;
    color: white;
}

.btn-secondary:hover {
    background: #6a3f94;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ============================================
   БЕЙДЖИ
   ============================================ */
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-own {
    background: #667eea;
    color: white;
}

.badge-pending {
    background: #f39c12;
    color: white;
}

.badge-success {
    background: #2ecc71;
    color: white;
}

/* ============================================
   ФЛЕШ-СООБЩЕНИЯ
   ============================================ */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    width: 100%;
}

.flash {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.4s ease;
}

.flash-success {
    background: #d5f5e3;
    color: #27ae60;
    border-left: 4px solid #27ae60;
}

.flash-error {
    background: #fadbd8;
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   ФОРМЫ
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.form-checkbox label {
    margin-bottom: 0;
    cursor: pointer;
}

/* ============================================
   ХЕДЕР
   ============================================ */
.header {
    background: white;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 65px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: #667eea;
}

.logo-text {
    font-size: 18px;
}

.main-nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #f0f0f0;
    color: #333;
}

.nav-link.active {
    background: #667eea;
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-bell {
    position: relative;
    font-size: 22px;
    cursor: pointer;
    padding: 5px;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 18px;
    text-align: center;
}

.user-menu {
    position: relative;
    cursor: pointer;
}

.user-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    transition: 0.3s;
}

.user-avatar img:hover {
    border-color: #667eea;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    padding: 8px 0;
    z-index: 100;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 20px;
    color: #333;
    font-size: 14px;
    transition: 0.3s;
}

.user-dropdown a:hover {
    background: #f5f5f5;
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 5px 0;
}

/* ============================================
   ФУТЕР
   ============================================ */
.footer {
    background: white;
    border-top: 1px solid #eee;
    padding: 20px 0;
    margin-top: 40px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: #999;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a:hover {
    color: #667eea;
}

/* ============================================
   ПАГИНАЦИЯ
   ============================================ */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    font-size: 14px;
}

.page-link:hover {
    background: #f5f5f5;
    border-color: #667eea;
}

.page-link.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-dots {
    padding: 8px 10px;
    color: #999;
}

/* ============================================
   ОФЛАЙН-БАННЕР
   ============================================ */
.offline-banner {
    display: none;
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.offline-banner.active {
    display: block;
}

/* ============================================
   ПУСТЫЕ СОСТОЯНИЯ
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.empty-state-icon {
    font-size: 60px;
    display: block;
    margin-bottom: 15px;
}

.empty-state h3 {
    color: #333;
    margin-bottom: 10px;
}

.empty-state p {
    color: #999;
    margin-bottom: 20px;
}

/* ============================================
   УВЕДОМЛЕНИЕ ОБ ОБНОВЛЕНИИ (PWA)
   ============================================ */
.update-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
}

.update-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.update-content button {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ============================================
   АУТЕНТИФИКАЦИЯ (LOGIN / REGISTER)
   ============================================ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
}

.auth-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 28px;
    color: #333;
}

.auth-header p {
    color: #666;
    margin-top: 5px;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-links a {
    color: #667eea;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-links span {
    margin: 0 10px;
    color: #ccc;
}

.register-box {
    max-width: 480px;
}

.combination-item {
    aspect-ratio: 1 / 1;
}

.combination-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}