:root {
    --primary-color: #4CAF50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --success-color: #4CAF50;
    --gray-light: #f5f5f5;
    --gray: #9e9e9e;
    --gray-dark: #616161;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

header h1 {
    color: var(--gray-dark);
    font-size: 28px;
}

nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Кнопки */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-outline {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

.btn-disabled {
    background: var(--gray);
    color: white;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
}

.btn-link {
    background: none;
    color: var(--primary-color);
    padding: 5px 0;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Сетка желаний */
.wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.wish-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.wish-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.wish-card.booked {
    opacity: 0.7;
    filter: grayscale(0.3);
}

.wish-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wish-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    color: var(--gray);
    font-size: 18px;
    text-align: center;
}

.wish-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wish-content h3 {
    margin-bottom: 10px;
    color: var(--gray-dark);
    font-size: 20px;
}

.description {
    color: #666;
    margin-bottom: 15px;
    flex: 1;
}

.price {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.wish-status {
    margin-bottom: 15px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.status-available {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-booked {
    background: #ffebee;
    color: #c62828;
}

.booked-by {
    margin-top: 8px;
    font-size: 14px;
    color: var(--gray-dark);
}

/* Формы */
.form-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

/* Таблица администратора */
.admin-table-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: var(--gray-light);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-dark);
    border-bottom: 2px solid #e0e0e0;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.admin-table tr:hover {
    background: #fafafa;
}

.row-booked {
    background: #fff3e0;
}

.table-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.no-image-small {
    color: var(--gray);
    font-size: 12px;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-edit {
    background: var(--warning-color);
    color: white;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 500px;
    position: relative;
    animation: slideIn 0.3s ease;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: var(--gray);
    cursor: pointer;
}

.close:hover {
    color: var(--gray-dark);
}

/* Сообщения */
.messages {
    margin-bottom: 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Страница входа */
.login-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    max-width: 400px;
    margin: 100px auto;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--gray-dark);
}

.login-form {
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
}

.hint {
    margin-top: 20px;
    color: var(--gray);
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 60px;
    background: white;
    border-radius: var(--border-radius);
    color: var(--gray);
    font-size: 18px;
}

.empty-table {
    text-align: center;
    padding: 30px !important;
    color: var(--gray);
}

.current-image {
    margin-bottom: 10px;
}

.edit-thumbnail {
    max-width: 200px;
    border-radius: 8px;
}

small {
    color: var(--gray);
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    .wishlist-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 90%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .admin-table {
        font-size: 14px;
    }
}