/* ============================================
   ПОРТФОЛИО УЧИТЕЛЯ — СОВРЕМЕННЫЙ ДИЗАЙН
   Строгий, чистый, профессиональный
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #fafaf8;
    --surface: #ffffff;
    --surface-alt: #f5f4f0;
    --text: #1a1a1a;
    --text-secondary: #5c5c5c;
    --text-muted: #999;
    --border: #e8e5df;
    --border-light: #f0ede8;
    --accent: #4a6741;
    --accent-hover: #3d5536;
    --accent-light: #e8efe5;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   НАВИГАЦИЯ — ЧИСТАЯ, СТРОГАЯ
   ============================================ */

#magnet-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.magnet-board {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    height: 60px;
    gap: 8px;
}

.magnet-stickers-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Навигационные ссылки */
.magnet-sticker {
    position: relative;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.magnet-sticker:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.magnet-sticker.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

/* Логотип */
.logo-sticker {
    padding: 6px 12px;
    gap: 10px;
}
.logo-sticker .sticker-content {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-img {
    width: 36px; height: 36px;
    border-radius: 8px;
    object-fit: cover;
}
.logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

/* Кнопка выхода */
.exit-sticker {
    color: #c0392b;
}
.exit-sticker:hover {
    background: #fef5f5;
    color: #a93226;
}

/* Поиск */
.search-sticker {
    padding: 4px 8px;
}
.search-sticker-content {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-alt);
    border-radius: 8px;
    padding: 4px 6px 4px 14px;
    border: 1px solid transparent;
    transition: all var(--transition);
}
.search-sticker-content:focus-within {
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74,103,65,0.08);
}
.search-sticker-content input {
    border: none;
    background: transparent;
    padding: 6px 0;
    font-size: 0.9rem;
    outline: none;
    width: 160px;
    color: var(--text);
}
.search-sticker-content input::placeholder { color: var(--text-muted); }
.search-sticker-content button {
    background: var(--accent);
    color: #fff;
    border: none;
    width: 32px; height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-sticker-content button:hover { background: var(--accent-hover); }

/* Убираем стикер-пины */
.sticker-pin { display: none; }

/* Админ-доска */
.admin-board { justify-content: center; gap: 4px; }

/* ============================================
   ДОСКА (HEADER) — ЭЛЕГАНТНАЯ
   ============================================ */

#chalkboard-header {
    position: relative;
    background: #3d5536;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 520px;
    height: 65vh;
    margin: 0;
    overflow: hidden;
}

#chalkboard-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
    z-index: 1;
}

#chalkCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
}

#eraser {
    position: absolute;
    bottom: 28px; right: 32px;
    width: 44px; height: 36px;
    cursor: pointer;
    z-index: 10;
    opacity: 0.5;
    transition: all var(--transition);
}
#eraser:hover { opacity: 1; transform: scale(1.08); }
#eraser svg { width: 100%; height: 100%; }

#chalk-tools {
    position: absolute;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 8px;
    z-index: 10;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}
.chalk-btn {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.25);
    cursor: pointer;
    transition: all var(--transition);
    opacity: 0.6;
}
.chalk-btn:hover { opacity: 1; transform: scale(1.2); }
.chalk-btn.active { opacity: 1; border-color: #fff; transform: scale(1.15); }

#container-header-text {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 600px;
    padding: 0 24px;
}
#container-header-text h1 {
    font-size: 3.2rem;
    font-weight: 300;
    color: #fff;
    letter-spacing: -1px;
    margin-bottom: 16px;
}
#container-header-text hr {
    border: none;
    height: 1px;
    background: rgba(255,255,255,0.2);
    width: 60px;
    margin: 20px auto;
}
#container-header-text h3 {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.7);
    font-weight: 400;
    margin: 6px 0;
    line-height: 1.5;
}
#container-header-text a {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 28px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    color: #fff !important;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    pointer-events: all;
}
#container-header-text a:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

/* ============================================
   MAIN
   ============================================ */

main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 60px;
}

/* Инфо-блок */
#info-block {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
}
#info-block img {
    width: 180px; height: 180px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}
#info-text h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}
#info-text p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.6;
}

/* Заголовки секций */
.section-heading {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 24px;
}

/* Карточки */
#materials { display: flex; flex-direction: column; gap: 48px; }
#metodichki, #programs { display: flex; flex-direction: column; }

#card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--surface);
    padding: 20px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
    transition: all var(--transition);
    margin-bottom: 12px;
}
#card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border);
}
.card-icon { font-size: 1.5rem; flex-shrink: 0; opacity: 0.6; }
.card-content { flex: 1; }
.card-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.card-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.btn-primary {
    padding: 8px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    display: inline-block;
}
.btn-primary:hover { background: var(--accent-hover); }

.login-hint { font-size: 0.8rem; color: var(--text-muted); }
.empty-message { text-align: center; color: var(--text-muted); padding: 32px 0; }

/* Footer */
footer {
    background: var(--text);
    color: rgba(255,255,255,0.6);
    padding: 24px;
    text-align: center;
    font-size: 0.85rem;
}
footer a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color var(--transition);
}
footer a:hover { color: #fff; }
.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* Кнопка назад */
.back-btn {
    position: fixed;
    top: 80px; left: 24px;
    width: 40px; height: 40px;
    background: var(--surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    z-index: 50;
    font-size: 1rem;
    transition: all var(--transition);
}
.back-btn:hover { transform: scale(1.05); box-shadow: var(--shadow); }

/* ============================================
   ФОРМЫ
   ============================================ */

#sign, #registration {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.search-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 24px 40px;
}

.form-sticker, .form-container {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
    max-width: 460px;
    width: 100%;
}
.form-sticker h1, .form-container h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 28px;
    text-align: center;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.form-row label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 100px;
}
.form-row input:not([type="radio"]),
.form-row select {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition);
    background: var(--bg);
}
.form-row input:focus,
.form-row select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74,103,65,0.06);
    background: var(--surface);
}
.radio-row { gap: 8px; }
.radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 400;
}
.radio-label input[type="radio"] { width: auto; margin: 0; }

.submit, .form-container button {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 8px;
}
.submit:hover, .form-container button:hover { background: var(--accent-hover); }

/* Поиск */
.search-result-sticker { max-width: 100%; }
.search-results { margin-top: 16px; }
.file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    margin-bottom: 8px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    gap: 16px;
    transition: all var(--transition);
}
.file:hover { background: var(--surface-alt); }
.file-info h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 2px; }
.file-info p { font-size: 0.8rem; color: var(--text-muted); }

/* ============================================
   АДМИН-ПАНЕЛЬ
   ============================================ */

.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}
.content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 32px;
}

.form-container label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.form-container input,
.form-container textarea {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition);
    background: var(--bg);
}
.form-container textarea { resize: vertical; min-height: 100px; }
.form-container input:focus,
.form-container textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74,103,65,0.06);
    background: var(--surface);
}

#materialsInfo {
    background: var(--surface);
    padding: 20px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
    margin-bottom: 12px;
}
.material-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
#materialsInfo p { font-size: 0.9rem; color: var(--text); margin-bottom: 4px; }
#control-materials { display: flex; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.remove {
    padding: 6px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: #c0392b;
    border: 1px solid #f5c6cb;
    transition: all var(--transition);
}
.remove:hover { background: #c0392b; color: #fff; border-color: #c0392b; }

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    #chalkboard-header { min-height: 380px; height: 50vh; }
    #container-header-text h1 { font-size: 2.2rem; }
    #container-header-text h3 { font-size: 0.9rem; }
    #chalk-tools { gap: 6px; padding: 6px 12px; }
    .chalk-btn { width: 18px; height: 18px; }
    #eraser { width: 36px; height: 30px; right: 20px; bottom: 20px; }
    
    .magnet-board { gap: 2px; }
    .magnet-sticker { padding: 6px 10px; font-size: 0.8rem; }
    .search-sticker-content input { width: 100px; }
    .logo-img { width: 28px; height: 28px; }
    .logo-text { font-size: 0.9rem; }
    
    #info-block { flex-direction: column; align-items: center; text-align: center; gap: 24px; padding: 28px; }
    #info-block img { width: 140px; height: 140px; }
    
    #card { flex-direction: column; text-align: center; }
    .card-content { text-align: center; }
    
    .footer-content { flex-direction: column; }
    
    .form-row { flex-direction: column; align-items: flex-start; }
    .form-row label { min-width: auto; }
    .form-row input:not([type="radio"]),
    .form-row select { width: 100%; }
}

@media (max-width: 480px) {
    #chalkboard-header { min-height: 300px; height: 40vh; }
    #container-header-text h1 { font-size: 1.8rem; }
    
    .magnet-board { flex-wrap: wrap; justify-content: center; }
    .magnet-sticker { font-size: 0.75rem; padding: 5px 8px; }
    .search-sticker-content input { width: 80px; }
    
    main { padding: 32px 16px 60px; }
    .form-sticker, .form-container { padding: 28px 20px; }
}