/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Geologica', system-ui, sans-serif;
    font-weight: 300; /* Light */
    line-height: 1.6;
    color: #333;
    background-color: #e9ecef;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #287887 0%, #205172 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    flex-wrap: nowrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 0;
}

.logo-img {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
}



/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

.main-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* ---------------------------------------------------------------
   Utility classes (student area friendly)
   Inspired by Tailwind for quick layout styling
---------------------------------------------------------------- */
/* Radius */
.u-rounded-2xl { border-radius: 1rem; }

/* Border */
.u-border { border: 1px solid #e5e7eb; }

/* Backgrounds */
.u-bg-white { background-color: #ffffff; }

/* Shadows */
.u-shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }

/* Spacing */
.u-p-4 { padding: 1rem; }
.u-mb-4 { margin-bottom: 1rem; }
.u-mt-6 { margin-top: 1.5rem; }

/* Grid helpers */
.u-grid { display: grid; }
.u-grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.u-col-span-4 { grid-column: span 4 / span 4; }
.u-col-span-8 { grid-column: span 8 / span 8; }

/* ---------------------------------------------------------------
   Empty-state placeholders for student containers
   Applies when block is visually empty (no element children)
---------------------------------------------------------------- */
.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4:empty,
.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4:not(:has(*)) {
    position: relative;
    min-height: 120px;
}

.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4:empty::before,
.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4:not(:has(*))::before {
    content: 'Здесь пока нет данных';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6b7280; /* gray-500 */
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

/* Custom message via data-empty attribute */
.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4[data-empty]:empty::before,
.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4[data-empty]:not(:has(*))::before {
    content: attr(data-empty);
}

/* Back-compat + robust empty-state (separate rules for :empty and :has) */
/* Fallback for old class combo and whitespace-only containers */
.rounded-2xl.border.bg-white.shadow-sm.p-4:empty { position: relative; min-height: 120px; }
.rounded-2xl.border.bg-white.shadow-sm.p-4:empty::before {
    content: 'Здесь пока нет данных';
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: #6b7280; font-size: 0.95rem; line-height: 1.4; text-align: center;
    padding: 0.5rem 0.75rem; border-radius: 0.5rem;
}
.rounded-2xl.border.bg-white.shadow-sm.p-4[data-empty]:empty::before { content: attr(data-empty); }

@supports selector(:has(*)) {
  .rounded-2xl.border.bg-white.shadow-sm.p-4:not(:has(*)) { position: relative; min-height: 120px; }
  .rounded-2xl.border.bg-white.shadow-sm.p-4:not(:has(*))::before {
      content: 'Здесь пока нет данных';
      position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
      color: #6b7280; font-size: 0.95rem; line-height: 1.4; text-align: center;
      padding: 0.5rem 0.75rem; border-radius: 0.5rem;
  }
  .rounded-2xl.border.bg-white.shadow-sm.p-4[data-empty]:not(:has(*))::before { content: attr(data-empty); }
}

/* ---------------------------------------------------------------
   Align specific card spacing with mt-6
   For blocks using: rounded-2xl border bg-white shadow-sm p-4 mb-4
   make them behave like mt-6 cards without changing markup.
---------------------------------------------------------------- */
.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4.u-mb-4 {
    margin-bottom: 0;      /* neutralize mb-4 */
    margin-top: 1.5rem;    /* same as mt-6 */
    margin-left: auto;     /* push to the right in block/flex */
    justify-self: end;     /* align to right in CSS Grid */
    width: 100%;           /* match width of standard cards */
}

/* Back-compat spacing tweak for old class combo */
.rounded-2xl.border.bg-white.shadow-sm.p-4.mb-4 {
    margin-bottom: 0;      /* neutralize mb-4 */
    margin-top: 1.5rem;    /* same as mt-6 */
    margin-left: auto;     /* push to the right in block/flex */
    justify-self: end;     /* align to right in CSS Grid */
    width: 100%;           /* match width of standard cards */
}

/* ---------------------------------------------------------------
   Work area layout (target 1920x1080, workzone ~1169x686)
   Two columns: left ≈385x674, right ≈780x677
   Responsive fallbacks keep proportions below 1440px
---------------------------------------------------------------- */
.u-workzone {
    /* Tunable variables */
    --u-work-max-w: 1169px;
    --u-work-min-h: 686px;
    --u-work-left-w: 385px;
    --u-work-left-h: 674px;
    --u-work-right-w: 780px;
    --u-work-right-h: 677px;
    --u-work-gap: 4px;

    display: grid;
    grid-template-columns: 1fr; /* stack by default */
    gap: var(--u-work-gap);
    margin: 0 auto;
    width: 100%;
}

/* Large screens: apply exact pixel split */
@media (min-width: 1440px) {
    .u-workzone {
        max-width: var(--u-work-max-w);
        min-height: var(--u-work-min-h);
        grid-template-columns: var(--u-work-left-w) var(--u-work-right-w);
    }
    .u-work-left { height: var(--u-work-left-h); }
    .u-work-right { height: var(--u-work-right-h); }
}

/* Medium screens: proportional split ~33% / 67% */
@media (min-width: 1024px) and (max-width: 1439px) {
    .u-workzone {
        max-width: var(--u-work-max-w);
        grid-template-columns: 33% 67%;
        min-height: calc(var(--u-work-min-h) * 0.9);
    }
    .u-work-left, .u-work-right { min-height: 480px; }
}

/* Small screens: stacked cards */
@media (max-width: 1023px) {
    .u-workleft, .u-work-right { min-height: 360px; }
}

/* Sidebar Navigation */
.sidebar {
    background: #f8f9fa;
    padding: 2rem 0;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: block;
    padding: 15px 25px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, #287887 0%, #205172 100%);
    color: white;
    border-left-color: #fff;
    transform: translateX(5px);
}

/* Content Area */
.content-area {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    padding: 2rem;
}

.content-text {
    min-height: 400px;
}

.content-section {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-section h2 {
    color: #287887;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.content-section p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.content-section ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content-section li {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Teacher Photo */
.teacher-photo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.teacher-img {
    width: 100%;
    max-width: 280px;
    height: 350px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.teacher-img:hover {
    transform: scale(1.05);
}

/* Reviews */
.reviews-list {
    margin-top: 1rem;
}

.review {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 4px solid #287887;
}

.review p {
    font-style: italic;
    margin-bottom: 0.5rem;
}

.review-author {
    color: #287887;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .content-area {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sidebar {
        order: 2;
    }
    
    .content-area {
        order: 1;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .logo {
        justify-content: center;
    }
}

/* ---------------------------------------------------------------
   Fixed widths for requested containers
   Group A (370px):
     - rounded-2xl border bg-white shadow-sm p-5
     - col-span-4 rounded-2xl border bg-white shadow-sm p-4
   Group B (765px):
     - rounded-2xl border bg-white shadow-sm
     - mt-6 rounded-2xl border bg-white shadow-sm p-4
     - rounded-2xl border bg-white shadow-sm p-4 mb-4
     - col-span-8 rounded-2xl border bg-white shadow-sm p-4
   Notes: box-sizing is border-box (Tailwind), width includes padding/border.
---------------------------------------------------------------- */
/* Group A: 370px */
.rounded-2xl.border.bg-white.shadow-sm.p-5 { width: 370px; }
.col-span-4.rounded-2xl.border.bg-white.shadow-sm.p-4 { width: 370px; }

/* Group B: 765px */
.rounded-2xl.border.bg-white.shadow-sm { width: 765px; }
.mt-6.rounded-2xl.border.bg-white.shadow-sm.p-4 { width: 765px; }
.rounded-2xl.border.bg-white.shadow-sm.p-4.mb-4 { width: 765px; }
.col-span-8.rounded-2xl.border.bg-white.shadow-sm.p-4 { width: 765px; }

/* Optional: prefixed u-variants */
.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-5 { width: 370px; }
.u-col-span-4.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4 { width: 370px; }
.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm { width: 765px; }
.u-mt-6.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4 { width: 765px; }
.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4.u-mb-4 { width: 765px; }
.u-col-span-8.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4 { width: 765px; }

/* ---------------------------------------------------------------
   Stack specific cards vertically with 24px gap
   Targets the four requested combinations
---------------------------------------------------------------- */
.rounded-2xl.border.bg-white.shadow-sm,
.mt-6.rounded-2xl.border.bg-white.shadow-sm.p-4,
.rounded-2xl.border.bg-white.shadow-sm.p-4.mb-4,
.col-span-8.rounded-2xl.border.bg-white.shadow-sm.p-4 {
    display: block;
    margin-top: 0 !important;       /* override mt-6/top tweaks */
    margin-bottom: 24px !important; /* 24px gap between cards */
    margin-left: 24px !important;   /* consistent left offset */
    clear: both;
}

/* Optional: prefixed u-variants */
.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm,
.u-mt-6.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4,
.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4.u-mb-4,
.u-col-span-8.u-rounded-2xl.u-border.u-bg-white.u-shadow-sm.u-p-4 {
    display: block;
    margin-top: 0 !important;
    margin-bottom: 24px !important;
    margin-left: 24px !important;
    clear: both;
}
