/* ================================================================
   EduPlatform — Refined Editorial Design System
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Serif+Display&display=swap');

:root {
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
    --ink: #1a1d26;
    --ink-light: #4a4e5a;
    --ink-muted: #8b8f9e;
    --surface: #fafaf8;
    --surface-raised: #ffffff;
    --surface-sunken: #f0f0ec;
    --border: #e4e3df;
    --border-light: #eeedea;
    --accent: #2d5a3d;
    --accent-light: #e8f0eb;
    --accent-hover: #234a31;
    --accent-text: #ffffff;
    --warm: #c4553a;
    --warm-light: #fdf0ed;
    --gold: #a07c4f;
    --gold-light: #faf6ef;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(26,29,38,0.04);
    --shadow-md: 0 4px 16px rgba(26,29,38,0.06);
    --shadow-lg: 0 12px 40px rgba(26,29,38,0.1);
    --shadow-focus: 0 0 0 3px rgba(45,90,61,0.15);
    --transition: 200ms cubic-bezier(0.25,0.1,0.25,1);
}

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

body {
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--ink);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

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

/* — Layout — */
.container { max-width: 860px; margin: 0 auto; padding: 2rem 1.5rem; }

/* — Navbar — */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 2rem; height: 64px;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(12px); background: rgba(250,250,248,0.88);
}
.logo { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); letter-spacing: -0.01em; }
.nav-right { display: flex; align-items: center; gap: 1.25rem; }
.user-email { font-size: 0.82rem; color: var(--ink-muted); }

/* — Typography — */
h1,h2,h3 { font-family: var(--font-display); color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }
.page-header { margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.page-header p { color: var(--ink-muted); margin-top: 0.5rem; font-size: 0.95rem; }
.section-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); margin-bottom: 0.75rem; }

/* — Buttons — */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-raised); color: var(--ink);
    font-family: var(--font-body); font-size: 0.85rem; font-weight: 500;
    cursor: pointer; transition: all var(--transition); line-height: 1.4;
}
.btn:hover { background: var(--surface-sunken); border-color: var(--ink-muted); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-block { display: flex; justify-content: center; width: 100%; }
.btn-ghost { background: none; border: none; color: var(--ink-muted); padding: 0.4rem 0.5rem; }
.btn-ghost:hover { color: var(--ink); background: none; }

/* — Cards — */
.card {
    display: block; background: var(--surface-raised);
    border: 1px solid var(--border-light); border-radius: var(--radius-md);
    padding: 1.5rem; transition: all var(--transition); position: relative;
}
.card:hover { border-color: var(--border); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-grid { display: grid; gap: 0.75rem; }
.card h3 { margin-bottom: 0.35rem; font-size: 1.1rem; }
.card-meta { font-size: 0.82rem; color: var(--ink-muted); display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }

/* — Badges — */
.badge {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.65rem; border-radius: 100px;
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
}
.badge-org { background: var(--accent-light); color: var(--accent); }
.badge-user { background: var(--surface-sunken); color: var(--ink-muted); }

/* — Auth — */
.auth-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--surface); position: relative;
}
.auth-wrapper::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 45vh;
    background: var(--ink);
}
.auth-card {
    position: relative; width: 100%; max-width: 400px;
    background: var(--surface-raised); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 3rem 2.5rem; text-align: center;
    animation: auth-rise 0.5s ease-out;
}
@keyframes auth-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.auth-card .logo-mark {
    width: 48px; height: 48px; background: var(--accent);
    border-radius: var(--radius-md); display: flex; align-items: center;
    justify-content: center; margin: 0 auto 1.5rem;
    color: white; font-family: var(--font-display); font-size: 1.4rem;
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 0.35rem; }
.auth-card .subtitle { color: var(--ink-muted); font-size: 0.9rem; margin-bottom: 2rem; }

/* — Forms — */
.form-group { margin-bottom: 1rem; text-align: left; }
.form-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--ink-light); margin-bottom: 0.35rem; }
.form-input {
    width: 100%; padding: 0.7rem 0.9rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 0.95rem; color: var(--ink);
    background: var(--surface-raised); transition: all var(--transition);
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.form-input::placeholder { color: var(--ink-muted); }
textarea.form-input { resize: vertical; min-height: 100px; }
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238b8f9e' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.5rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.error { color: var(--warm); font-size: 0.82rem; margin-top: 0.5rem; }
.success-msg { color: var(--accent); font-size: 0.85rem; margin-top: 0.5rem; font-weight: 500; }
.otp-input { font-size: 1.8rem; text-align: center; letter-spacing: 0.5em; font-weight: 600; padding: 0.8rem; }

/* — Tabs — */
.tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border);
    margin-bottom: 2rem; overflow-x: auto;
}
.tab {
    padding: 0.75rem 1.25rem; background: none; border: none; cursor: pointer;
    font-family: var(--font-body); font-size: 0.85rem; font-weight: 500;
    color: var(--ink-muted); border-bottom: 2px solid transparent;
    margin-bottom: -1px; white-space: nowrap; transition: all var(--transition);
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: tab-fade 0.25s ease-out; }
@keyframes tab-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* — Day Toggle — */
.day-toggle {
    display: flex; gap: 0.25rem; margin-bottom: 1.5rem;
    background: var(--surface-sunken); border-radius: var(--radius-sm);
    padding: 0.2rem; width: fit-content;
}
.day-toggle .btn { border: none; background: transparent; border-radius: calc(var(--radius-sm) - 2px); font-size: 0.8rem; padding: 0.4rem 1rem; }
.day-toggle .btn.active { background: var(--surface-raised); box-shadow: var(--shadow-sm); color: var(--ink); }

/* — Sessions — */
.session-card {
    display: grid; grid-template-columns: 100px 1fr auto; gap: 0.75rem; align-items: start;
    padding: 1.1rem 1.25rem; background: var(--surface-raised);
    border: 1px solid var(--border-light); border-radius: var(--radius-md);
    margin-bottom: 0.5rem; transition: border-color var(--transition);
}
.session-card:hover { border-color: var(--border); }
.session-time { font-weight: 600; font-size: 0.9rem; color: var(--accent); white-space: nowrap; }
.session-duration { font-size: 0.78rem; color: var(--ink-muted); font-weight: 400; }
.session-title { font-weight: 500; margin-bottom: 0.2rem; }
.session-speaker { font-size: 0.82rem; color: var(--ink-muted); }
.ws-badge { background: var(--gold-light); color: var(--gold); padding: 0.15rem 0.55rem; border-radius: 100px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }

/* — Links — */
.link-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.85rem 1rem; background: var(--surface-raised);
    border: 1px solid var(--border-light); border-radius: var(--radius-sm);
    margin-bottom: 0.35rem; transition: all var(--transition); font-size: 0.9rem; font-weight: 500;
}
.link-item::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.link-item:hover { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }

/* — Ratings — */
.rating-prompt { text-align: center; padding: 2rem; }
.rating-prompt h3 { margin-bottom: 0.5rem; }
.rating-prompt p { color: var(--ink-muted); margin-bottom: 1.5rem; }
.rating-buttons { display: flex; justify-content: center; gap: 0.65rem; }
.btn-rate {
    width: 52px; height: 52px; border-radius: 50%;
    border: 2px solid var(--border); background: var(--surface-raised);
    font-size: 1.1rem; font-weight: 700; font-family: var(--font-body);
    cursor: pointer; color: var(--ink-light); transition: all var(--transition);
}
.btn-rate:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); transform: scale(1.08); }

/* — Feedback — */
.feedback-card {
    padding: 1.1rem 1.25rem; background: var(--surface-raised);
    border: 1px solid var(--border-light); border-radius: var(--radius-md); margin-bottom: 0.5rem;
}
.feedback-card .fb-meta { font-size: 0.78rem; color: var(--ink-muted); margin-bottom: 0.35rem; font-weight: 500; }
.feedback-card p { font-size: 0.9rem; line-height: 1.55; }
.feedback-card small { font-size: 0.75rem; color: var(--ink-muted); display: block; margin-top: 0.4rem; }

/* — Stream Header — */
.stream-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.back-link { font-size: 0.82rem; color: var(--ink-muted); display: flex; align-items: center; gap: 0.3rem; }
.back-link:hover { color: var(--ink); }
.stream-header h2 { flex: 1; }

/* — Manage — */
.manage-section { margin-bottom: 2.5rem; }
.manage-section h3 { margin-bottom: 1rem; font-size: 1rem; }
.manage-section+.manage-section { padding-top: 2rem; border-top: 1px solid var(--border-light); }

/* — Dialog — */
dialog {
    border: none; border-radius: var(--radius-lg); padding: 2.5rem;
    box-shadow: var(--shadow-lg); max-width: 440px; width: 90%; font-family: var(--font-body);
}
dialog::backdrop { background: rgba(26,29,38,0.4); backdrop-filter: blur(4px); }
dialog h3 { margin-bottom: 1.5rem; }
.dialog-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; justify-content: flex-end; }

/* — Empty — */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--ink-muted); }
.empty { color: var(--ink-muted); padding: 2rem; text-align: center; font-size: 0.9rem; }

/* — Responsive — */
@media(max-width:640px){
    .container{padding:1.25rem 1rem} .navbar{padding:0 1rem}
    .auth-card{padding:2rem 1.5rem;margin:0 1rem}
    .tab{padding:0.6rem 0.75rem;font-size:0.8rem}
    .session-card{grid-template-columns:80px 1fr}
    .session-card>:last-child{grid-column:1/-1}
    .form-row{grid-template-columns:1fr}
    h1{font-size:1.5rem} h2{font-size:1.25rem}
}

/* Контейнер для выравнивания в одну строку */
.schedule-controls {
    display: flex;
    justify-content: space-between; /* Разносит элементы по краям */
    align-items: center;           /* Выравнивает их по вертикальному центру */
    margin-bottom: 2rem;
    gap: 1rem;
}

/* Убираем лишний отступ у переключателя, который мешает центровке */
.schedule-controls .day-toggle {
    margin-bottom: 0 !important;
}

/* Сама кнопка в стиле проекта */
.btn-create-session {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface-raised);
    color: var(--accent);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap; /* Запрещаем тексту кнопки переноситься */
    transition: all var(--transition);
}

.btn-create-session:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-1px);
}

/* Адаптив для мобильных устройств */
@media (max-width: 640px) {
    .schedule-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    .btn-create-session {
        width: 100%;
        justify-content: center;
    }
}
