/* Базовые стили без конфликтов с menu.css */
:root {
    --bg-primary: #121212;
    --bg-secondary: #1C2526;
    --bg-header: #1C2526;
    --text-primary: #FFFFFF;
    --text-secondary: #A0A6AB;
    --accent: #007AFF;
    --error: #FF3B30;
    --success: #34C759;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --animation-duration: 0.3s;
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: var(--bg-header);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100; /* Ниже .sidebar */
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 24px;
    font-weight: 600;
}

main {
    margin-left: 0;
    padding: 20px;
}

main.with-sidebar {
    margin-left: 0;
    z-index: 50; /* Ниже .sidebar */
}

h2, h3, h4 {
    font-weight: 600;
    margin-bottom: 16px;
}

h2 {
    font-size: 28px;
}

h3 {
    font-size: 22px;
}

h4 {
    font-size: 18px;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    opacity: 0.8;
}

.card {
    background: rgb(23 25 25 / 80%);
    backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card h4, .card p {
    margin-bottom: 12px;
}

.card .text-secondary {
    font-size: 14px;
    opacity: 0.6;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent);
    color: var(--text-primary);
    border: none; /* Убираем белый бордер в Safari */
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    margin: 8px 8px 8px 0;
    -webkit-appearance: none; /* Отключаем нативный стиль в Safari */
}

.button:hover {
    background: #005BB5;
}

.button-danger {
    background: var(--error);
    border: none; /* Убираем белый бордер в Safari */
}

.button-danger:hover {
    background: #CC2E26;
}

.button-success {
    background: var(--success);
    border: none; /* Убираем белый бордер в Safari */
}

.button-success:hover {
    background: #2BAF49;
}

.button-primary {
    background: #5856D6;
    border: none; /* Убираем белый бордер в Safari */
}

.button-primary:hover {
    background: #4A48B5;
}

.search-form {
    display: flex;
    max-width: 400px;
    margin-bottom: 20px;
}

.search-form input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.search-form .button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin: 0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination a {
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    margin: 0;
}

.pagination a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.error {
    background: rgba(255, 59, 48, 0.2);
    color: var(--error);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
}

.card img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto 12px;
    display: block;
}

@media (max-width: 768px) {
    .card img {
        max-width: 150px;
    }
}

.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    main.with-sidebar {
        margin-left: 0;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 20px;
    }

    .search-form {
        max-width: 100%;
    }

    .button {
        padding: 10px 20px;
        font-size: 14px;
        margin: 6px 6px 6px 0;
    }
}

.wishlist-info {
    background: linear-gradient(135deg, var(--bg-secondary), #2a2f30);
    border: 2px solid var(--accent);
    padding: 24px;
    margin-bottom: 30px;
}

.wishlist-info h3 {
    display: flex;
    align-items: center;
    font-size: 24px;
    color: var(--accent);
    margin-bottom: 20px;
}

.wishlist-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wishlist-field {
    display: flex;
    align-items: center;
    font-size: 16px;
    color: var(--text-primary);
}

.wishlist-field .label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 8px;
}

.wishlist-field .value {
    font-weight: 500;
}

.divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 8px 0;
}

.joint-reserve-form {
    display: none;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-top: 20px;
}

.joint-reserve-form[style*="display: block"] {
    display: block;
}

.joint-reserve-form-content {
    max-width: 500px;
    margin: 0 auto;
}

.users-list {
    margin-bottom: 20px;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.user-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.user-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.user-item input[type="number"] {
    width: 120px;
}

@media (max-width: 768px) {
    .joint-reserve-form {
        padding: 15px;
    }

    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .user-item input[type="number"] {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .wishlist-info {
        padding: 16px;
    }

    .wishlist-info h3 {
        font-size: 20px;
    }

    .wishlist-details {
        gap: 6px;
    }

    .wishlist-field {
        font-size: 14px;
    }

    .divider {
        margin: 6px 0;
    }
}

.edit-wishlist-form {
    display: none;
    background: var(--bg-secondary, #1C2526);
    padding: 20px;
    border-radius: var(--border-radius, 12px);
    margin-top: 20px;
    border: 1px solid var(--accent, #007AFF);
}
.edit-wishlist-form[style*="display: block"] {
    display: block !important;
}

.gift-card {
    background: var(--bg-secondary, #1C2526);
    padding: 20px;
    border-radius: var(--border-radius, 12px);
    margin-bottom: 20px;
    border: 1px solid var(--accent, #007AFF);
}
.gift-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
}

/* Список ссылок */
.public-link {
    background: var(--bg-secondary, #1C2526);
    padding: 15px;
    border-radius: var(--border-radius, 8px);
    margin-bottom: 10px;
    border: 1px solid var(--accent, #007AFF);
    position: static;
    display: block;
}
.public-link p {
    margin: 5px 0;
    position: static;
}
.public-link a {
    color: var(--accent, #007AFF);
    text-decoration: underline;
    position: static;
}
.accordion {
    margin-bottom: 20px;
}
.accordion-trigger {
    width: 100%;
    text-align: left;
    padding: 10px 15px;
    font-size: 1.1em;
    font-weight: 500;
    border-radius: var(--border-radius, 8px);
    background: var(--bg-secondary, #1C2526);
    color: var(--text-primary, #E8ECEF);
    border: 1px solid var(--accent, #007AFF);
    cursor: pointer;
}
.accordion-panel {
    height: 0;
    opacity: 0;
    display: none;
    overflow: hidden;
    transition: height 0.3s ease-out, opacity 0.3s ease-out;
    position: static;
}
.accordion-panel.active {
    display: block;
    opacity: 1;
}
.accordion-panel h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    color: var(--text-primary, #E8ECEF);
    position: static;
}
.card {
    overflow: visible;
}
.container {
    min-height: auto;
}
main.with-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
footer {
    margin-top: auto;
}
select {
    width: 100%;
    padding: 12px 36px 12px 12px; /* Отступ для стрелки */
    border: 1px solid var(--accent, #007AFF);
    border-radius: var(--border-radius, 8px);
    background: var(--bg-primary, #121212);
    color: var(--text-primary, #E8ECEF);
    font-size: 1em;
    cursor: pointer;
    -webkit-appearance: none; /* Отключаем нативный стиль в Safari */
    -moz-appearance: none;
    appearance: none;
    position: relative;
}
select:focus {
    outline: none;
    border-color: var(--accent-hover, #005BB5);
}
select option {
    background: #FFFFFF;
    color: #000000;
}
select option:hover {
    background: #E0E0E0;
    color: #000000;
}
.change-wishlist-form select {
    background: var(--bg-primary, #121212);
    color: var(--text-primary, #E8ECEF);
    padding-right: 36px; /* Отступ для стрелки */
}
.change-wishlist-form {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}
.change-wishlist-form::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--text-primary, #E8ECEF);
    transform: translateY(-50%);
    pointer-events: none; /* Чтобы стрелка не мешала кликам */
}
.change-wishlist-form label {
    color: var(--text-primary, #FFFFFF);
    font-size: 0.9em;
}
.change-wishlist-form button {
    align-self: flex-start;
}
.wishlist-card {
    background: var(--bg-secondary, #1C2526);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: var(--border-radius, 8px);
    border: 1px solid var(--accent, #007AFF);
}
.wishlist-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    color: var(--text-primary, #E8ECEF);
}
.gift-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.gift-item {
    background: var(--bg-primary, #121212);
    padding: 15px;
    border-radius: var(--border-radius, 8px);
    border: 1px solid var(--accent, #007AFF);
}
.gift-item h4 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: var(--text-primary, #E8ECEF);
}
.gift-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}
.text-secondary {
    color: var(--text-secondary, #A0A6AB);
}
.copy-button {
    background: linear-gradient(135deg, var(--accent, #007AFF) 0%, #00C4B4 100%);
    color: var(--text-primary, #E8ECEF);
    border: none; /* Убираем белый бордер в Safari */
    border-radius: var(--border-radius, 8px);
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}
.copy-button:hover {
    background: linear-gradient(135deg, #005BB5 0%, #009688 100%);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}
.copy-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.copy-message {
    display: none;
    color: var(--success, #34C759);
    font-size: 0.9em;
    margin-top: 5px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}