/* === ТЁМНАЯ ТЕМА APPLE 2025 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #000000;
    --card-bg: #1c1c1e;
    --text: #f5f5f7;
    --text-secondary: #8e8e93;
    --accent: #0a84ff;
    --accent-hover: #0077ed;
    --danger: #ff453a;
    --success: #30d158;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f5f7;
        --card-bg: #ffffff;
        --text: #1d1d1f;
        --text-secondary: #6e6e73;
        --border: rgba(0, 0, 0, 0.1);
        --shadow: rgba(0, 0, 0, 0.1);
    }
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background 0.4s ease;
    padding-bottom: 80px;
}

/* Контейнер */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px;
}

/* Заголовки */
h1 {
    font-size: 42px;
    font-weight: 700;
    text-align: center;
    margin: 32px 0 16px;
    background: linear-gradient(90deg, #0a84ff, #5ac8fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
}

h1 + p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 17px;
    margin-bottom: 32px;
}

/* Навигация по категориям */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 32px 0;
    padding: 0 8px;
}

.categories a {
    padding: 11px 22px;
    background: var(--card-bg);
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px var(--shadow);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.categories a::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.categories a.active,
.categories a:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 132, 255, 0.3);
}

.categories a.active::before,
.categories a:hover::before {
    opacity: 1;
}

/* Карточки тренажёров */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    margin-top: 20px;
}

.equipment-card {
    background: var(--card-bg);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 8px 25px var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    position: relative;
}

.equipment-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(10,132,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.equipment-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.equipment-card:hover::before {
    opacity: 1;
}

.equipment-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.equipment-card:hover img {
    transform: scale(1.05);
}

.equipment-card .info {
    padding: 20px;
}

.equipment-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.equipment-card .category {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    background: rgba(10, 132, 255, 0.15);
    padding: 4px 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.equipment-card .desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
}

/* Формы */
.form-container, .login-container {
    max-width: 460px;
    margin: 60px auto;
    padding: 36px;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 12px 40px var(--shadow);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.form-container h1, .login-container h1 {
    font-size: 28px;
    margin-bottom: 24px;
    background: linear-gradient(90deg, #0a84ff, #5ac8fa);
    -webkit-background-clip: text;
    color: transparent;
}

input, textarea, select {
    width: 100%;
    padding: 16px;
    margin: 14px 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 17px;
    color: var(--text);
    transition: all 0.3s;
    font-family: inherit;
}

input::placeholder, textarea::placeholder {
    color: #8e8e93;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

button {
    width: 100%;
    padding: 16px;
    margin: 16px 0;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(10, 132, 255, 0.4);
}

.back {
    display: block;
    text-align: center;
    color: var(--accent);
    text-decoration: none;
    font-size: 15px;
    margin-top: 16px;
    font-weight: 500;
}

/* Админка */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 8px;
}

.add-btn {
    padding: 12px 24px;
    background: var(--success);
    color: white;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(48, 209, 88, 0.3);
    transition: all 0.3s;
}

.add-btn:hover {
    background: #28a745;
    transform: translateY(-2px);
}

.actions {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
}

.edit, .delete {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.edit {
    background: var(--accent);
    color: white;
}

.delete {
    background: var(--danger);
    color: white;
}

.logout-btn {
    color: var(--danger);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
}

/* Футер */
footer {
    text-align: center;
    margin-top: 60px;
    color: var(--text-secondary);
    font-size: 14px;
}

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

/* Адаптивность */
@media (max-width: 768px) {
    h1 { font-size: 34px; }
    .equipment-grid { grid-template-columns: 1fr; gap: 20px; }
    .form-container, .login-container { margin: 40px 16px; padding: 28px; }
    .categories a { padding: 10px 18px; font-size: 14px; }
}

/* Safari оптимизация */
@supports (-webkit-touch-callout: none) {
    input, button, select, textarea {
        -webkit-appearance: none;
        border-radius: 14px;
    }
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Плавные анимации загрузки */
.equipment-card {
    animation: fadeInUp 0.6s ease backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.equipment-card:nth-child(1) { animation-delay: 0.1s; }
.equipment-card:nth-child(2) { animation-delay: 0.2s; }
.equipment-card:nth-child(3) { animation-delay: 0.3s; }
/* и т.д. */