/*
 * StudyHub.AZ Layout Styles
 * Filename: layout.css
 * Author: Ostwind by Dr.FC
 * Контейнеры, отступы, flex/grid-сетка и базовая структура макета
 */

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: 90%; /* 1440px -> 90% */
  margin: 0 auto;
  padding: 2rem 1.25rem; /* 30px 20px -> 2rem 1.25rem */
}

/* Overflow visible for dropdowns */
.container,
.form-block,
.register-container {
  overflow: visible !important;
}

.main-login,
.main-welcome {
  min-height: 90vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: linear-gradient(145deg, #e1f0f7, #d4f0eb);
  position: relative;
  overflow: hidden;
}

.welcome-container {
  max-width: 90%; /* 840px -> 90% */
  padding: 0;
  backdrop-filter: blur(10px);
}

.welcome-box {
  background: rgba(255, 255, 255, 0.85);
  padding: 0 2.5rem; /* 0px 40px -> 0 2.5rem */
  border-radius: var(--radius);
  box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.1); /* 0 10px 40px -> 0 0.625rem 2.5rem */
  text-align: center;
  animation: fadeIn 0.7s ease-in-out;
}

.welcome-box h1 {
  font-size: 2.4rem;
  margin-bottom: 1.25rem; /* 20px -> 1.25rem */
  color: #1c1c1e;
}

.welcome-box p {
  font-size: 1.1rem;
  margin-bottom: 1.875rem; /* 30px -> 1.875rem */
  color: #333;
}

/* === ОБЩИЙ КОНТЕЙНЕР === */
.register-container {
  padding: 3.75rem 1.25rem; /* 60px 20px -> 3.75rem 1.25rem */
  background: #f8fbff;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.register-container h1 {
  text-align: center;
  margin-bottom: 2.5rem; /* 40px -> 2.5rem */
  color: #1c1c1e;
  font-size: 2.4rem;
}

.register-container .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* === СЕКЦИИ === */
.section-top.container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
}

.top-text, .top-image {
  flex: 1 1 45%;
  min-width: 300px;
}

.top-text {
  flex: 1;
  animation: fadeIn 0.7s ease-in-out;
}

.top-text h1 {
  font-size: 2.4rem;
  margin-bottom: 1.25rem; /* 20px -> 1.25rem */
  color: #1c1c1e;
  line-height: 1.2;
}

.top-text p {
  font-size: 1.1rem;
  margin-bottom: 1.875rem; /* 30px -> 1.875rem */
  color: #333;
  line-height: 1.6;
}

.top-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.7s ease-in-out;
}

.top-image img {
  max-width: 100%;
  height: auto;
  border-radius: 0.9375rem; /* 15px -> 0.9375rem */
  box-shadow: 0 0.9375rem 2.1875rem rgba(0, 0, 0, 0.1); /* 0 15px 35px -> 0 0.9375rem 2.1875rem */
}

/* === FEATURES SECTION === */
.section-features.container {
  margin-top: 3rem;
  text-align: center;
}

.section-features h2 {
  font-size: 2.2rem;
  margin-bottom: 2rem;
  color: #1c1c1e;
  font-weight: 600;
}

/* === FEATURES GRID === */
.features-wrapper {
  display: grid;
  /* === АДАПТИВНАЯ СЕТКА ДЛЯ ВСЕХ УСТРОЙСТВ === */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Адаптивная ширина от 280px до 1fr */
  gap: 1.875rem; /* 30px -> 1.875rem */
  margin-top: 1.25rem; /* 20px -> 1.25rem */
  justify-content: center; /* Центрирование сетки */
  max-width: 90%; /* 1200px -> 90% */
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.25rem; /* 0 20px -> 0 1.25rem */
  
  /* === ЛОГИКА ПЕРЕНОСА НА НОВУЮ СТРОКУ === */
  /* Если места не хватает для минимум 2 карточек (280px + gap + 280px = 580px), 
     то блок переносится на новую строку */
  min-width: 580px; /* Минимальная ширина для 2 карточек + gap */
}

/* === СЕКЦИЯ FEATURES С ЛОГИКОЙ ПЕРЕНОСА === */
.section-features {
  /* === АВТОМАТИЧЕСКИЙ ПЕРЕНОС НА НОВУЮ СТРОКУ === */
  /* Если контейнер не может вместить features-wrapper с минимальной шириной,
     то секция переносится на новую строку */
  clear: both; /* Очищаем float элементы */
  page-break-inside: avoid; /* Избегаем разрыва страницы */
  break-inside: avoid; /* Избегаем разрыва колонки */
  transition: all 0.3s ease; /* Плавный переход при переносе */
}

/* === ПРИНУДИТЕЛЬНЫЙ ПЕРЕНОС НА НОВУЮ СТРОКУ === */
.section-features.features-forced-new-line {
  clear: both !important;
  margin-top: 2rem !important;
  width: 100% !important;
  display: block !important;
  
  /* Анимация появления */
  animation: slideDownFeatures 0.5s ease-out;
}

/* === СТИЛИ РАЗДЕЛЕННОГО БЛОКА === */
.section-divider {
  padding: 3rem 0;
  text-align: center;
  background: linear-gradient(135deg, var(--color-bg-light) 0%, var(--color-bg-main) 100%);
  margin: 2rem 0;
}

.divider-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.divider-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  flex: 1;
  max-width: 100px;
}

.divider-icon {
  color: var(--color-primary);
  animation: bounce 2s infinite;
}

.divider-text h3 {
  color: var(--color-primary);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.divider-text p {
  color: var(--color-text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* === АДАПТИВНЫЕ СТИЛИ ПЕРЕНЕСЕНЫ В СООТВЕТСТВУЮЩИЕ ФАЙЛЫ === */
/* Media queries для section-features и features-wrapper перенесены в:
   - mobile.css (≤ 767px)
   - tablet.css (768px-1024px)
   - desktop.css (≥ 1025px)
*/

/* === TARIFF SECTION === */
.tariff-section {
  padding: 3.75rem 1.25rem; /* 60px 20px -> 3.75rem 1.25rem */
  background: #f8fbff;
}

.tariff-section h1 {
  text-align: center;
  margin-bottom: 2.5rem; /* 40px -> 2.5rem */
  color: #1c1c1e;
}

.tariff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  justify-items: center;
  gap: 1.5rem; /* 24px -> 1.5rem */
  align-items: stretch;
}

/* === GLOBAL DEPARTMENTS SECTION === */
.global-departments-section {
  background: var(--color-bg-glass);
  backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.6s ease-out;
}

.global-departments-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); /* 280px -> 17.5rem */
  gap: var(--space-md);
  margin: var(--space-md) 0;
}

/* === OR SEPARATOR === */
.or-separator {
  display: flex;
  align-items: center;
  margin: var(--space-lg) 0;
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.or-separator::before,
.or-separator::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--color-border);
}

.or-separator::before {
  margin-right: var(--space-md);
}

.or-separator::after {
  margin-left: var(--space-md);
}

/* === АДАПТИВНЫЕ СТИЛИ ПЕРЕНЕСЕНЫ В СООТВЕТСТВУЮЩИЕ ФАЙЛЫ === */
/* Media queries для layout перенесены в:
   - mobile.css (≤ 767px)
   - tablet.css (768px-1024px)
   - desktop.css (≥ 1025px)
*/ 

/* === 🎨 ADMIN LAYOUT STYLES === */
/* StudyHub.AZ - Admin Panel Layout Styles */

/* === ОСНОВНЫЕ СТИЛИ АДМИН ПАНЕЛИ === */
body.admin {
  background: linear-gradient(to right, #0c3c78, #0b7a3e);
  color: #fff;
  font-family: var(--font-main);
}

.admin-container {
  max-width: 90%; /* 1280px -> 90% */
  margin: 0 auto;
  padding: 2.5rem 1.25rem; /* 40px 20px -> 2.5rem 1.25rem */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === 🔧 API ADMIN LAYOUT === */
.api-settings-container {
  max-width: 90%; /* 1200px -> 90% */
  margin: 0 auto;
  padding: 1.25rem; /* 20px -> 1.25rem */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.management-header {
  background: var(--api-primary-gradient);
  color: white;
  padding: 1.5625rem 1.875rem; /* 25px 30px -> 1.5625rem 1.875rem */
  border-radius: var(--api-border-radius-lg);
  margin-bottom: 1.875rem; /* 30px -> 1.875rem */
  box-shadow: var(--api-shadow-medium);
}

.management-header h1 {
  margin: 0 0 1.25rem 0; /* 0 0 20px 0 -> 0 0 1.25rem 0 */
  font-size: 2rem;
  font-weight: 600;
}

.management-header h1 i {
  margin-right: 0.75rem; /* 12px -> 0.75rem */
  color: rgba(255, 255, 255, 0.9);
}

.management-block {
  background: white;
  border-radius: var(--api-border-radius-lg);
  padding: 1.5625rem; /* 25px -> 1.5625rem */
  margin-bottom: 1.5625rem; /* 25px -> 1.5625rem */
  box-shadow: var(--api-shadow-light);
  border: 1px solid var(--api-border-color);
  transition: var(--api-transition);
}

.management-block.active {
  box-shadow: var(--api-shadow-medium);
  transform: translateY(-0.125rem); /* -2px -> -0.125rem */
}

.management-block h2 {
  color: var(--api-text-color);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.25rem; /* 20px -> 1.25rem */
  display: flex;
  align-items: center;
}

.management-block h2 i {
  margin-right: 0.625rem; /* 10px -> 0.625rem */
  color: var(--api-primary-color);
}

.admin-header {
  font-size: 2rem;
  margin-bottom: 1.875rem; /* 30px -> 1.875rem */
  font-weight: 700;
  color: #fff;
  border-bottom: 0.125rem solid rgba(255, 255, 255, 0.2); /* 2px -> 0.125rem */
  padding-bottom: 0.625rem; /* 10px -> 0.625rem */
}

/* === SCHEDULE MODULE (из schedule.css) === */
.schedule-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
  font-family: var(--font-main);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
  color: var(--color-text-main);
  line-height: 1.6;
  overflow-x: visible;
}

.schedule-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 10px 20px var(--color-shadow);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
  animation: slideInDown 0.8s ease-out;
}

.schedule-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(12, 60, 120, 0.08), transparent);
  animation: rotate 20s linear infinite;
  pointer-events: none;
}

.schedule-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 24px;
  text-align: center;
  background: linear-gradient(to right, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 2;
  animation: titleGlow 3s ease-in-out infinite alternate;
}

.schedule-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.schedule-header-fixed {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: 10px;
  padding-bottom: 10px;
}

.schedule-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.calendar-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
  animation: fadeInUp 1s ease-out 0.3s both;
}

/* === teams/company_director/schedule.php === */
:root {
  --schedule-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --schedule-radius: 12px;
  --schedule-radius-lg: 16px;
}

.schedule-header-actions { margin-left: auto; }
.schedule-today-block {
  padding: 1rem 1.5rem;
  border-radius: var(--schedule-radius);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}
.schedule-today-label { color: var(--luxury-gold); font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.schedule-today-value { color: var(--executive-navy); font-size: 1.1rem; font-weight: 700; }

.executive-dashboard-luxury .schedule-controls {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.schedule-nav-card { flex: 1; min-width: 300px; }
.schedule-nav-title { margin-bottom: 1rem; text-align: center; }
.schedule-nav-title i { margin-right: 0.5rem; }
.schedule-nav-inner { display: flex; align-items: center; justify-content: space-between; }
.schedule-nav-month { color: var(--luxury-gold); font-size: 1.4rem; }
.schedule-actions-card { flex: 0 0 auto; }
.schedule-actions-title { margin-bottom: 1rem; text-align: center; }
.schedule-actions-title i { margin-right: 0.5rem; }

.schedule-calendar-card { margin-top: 3rem; }
.schedule-calendar-header { margin-bottom: 2rem; }
.schedule-calendar-icon { color: var(--luxury-gold); }
.schedule-calendar-title { font-size: 1.8rem; }
.schedule-trust-guarantee { text-align: center; margin-top: 1.5rem; }
.schedule-trust-guarantee i { margin-right: 0.5rem; }

.schedule-calendar-grid-wrapper { overflow-x: auto; }
.schedule-calendar-grid {
  width: 100%;
  border-collapse: collapse;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 215, 0, 0.05));
  border-radius: var(--schedule-radius-lg);
  overflow: hidden;
}
.schedule-calendar-head-row {
  background: linear-gradient(135deg, #92400e 0%, #b45309 50%, #78350f 100%);
}
.schedule-calendar-head-cell {
  padding: 1rem 0.75rem;
  background: linear-gradient(135deg, #92400e 0%, #b45309 50%, #78350f 100%);
  color: #ffffff !important;
  font-weight: 700;
  text-align: center;
  font-size: 1rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.schedule-cell {
  padding: 0;
  height: 120px;
  vertical-align: top;
  border: 1px solid rgba(255, 215, 0, 0.2);
}
.schedule-cell-inner {
  height: 100%;
  padding: 8px;
  transition: background var(--schedule-transition), border var(--schedule-transition);
}
.schedule-cell--today {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 255, 255, 0.1));
  border: 2px solid var(--luxury-gold);
  border-radius: 8px;
}
.schedule-cell-day {
  font-weight: 700;
  color: var(--executive-navy);
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.schedule-integration-card { margin-top: 2rem; text-align: center; }
.schedule-integration-icon { color: #3b82f6; }
.schedule-integration-title { color: #3b82f6; margin-bottom: 0.75rem; }
.schedule-integration-desc { margin-bottom: 1rem; }

.schedule-external-module {
  display: none;
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(59, 130, 246, 0.1);
  border-radius: var(--schedule-radius-lg);
  animation: scheduleFadeIn 0.3s ease-in-out;
}
.schedule-external-module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.schedule-external-module-title {
  color: #3b82f6;
  margin: 0;
}
.schedule-external-module-title i { margin-right: 0.5rem; }
.schedule-external-module-close { padding: 0.5rem 1rem; }
.schedule-external-module-content {
  background: white;
  padding: 1.25rem;
  border-radius: var(--schedule-radius);
  border: 2px solid #3b82f6;
}

.schedule-add-cell-btn {
  width: 100%;
  margin-top: 4px;
  padding: 4px;
  font-size: 0.65rem;
  background: rgba(255, 215, 0, 0.1);
  border: 1px dashed rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  color: var(--luxury-gold);
  cursor: pointer;
  transition: all 0.3s;
}