/* css/layout.css */

/* 1. Entry Section (Shifted Upwards & Prominent Box) */
#entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 40px 24px 32px 24px;
  background: var(--bg-main);
  transition: background 0.3s ease;
  box-sizing: border-box;
}

.entry-card {
  width: 88%;
  max-width: 620px;
  margin: 0 auto;
  display: block;
  padding: 32px 36px;
  min-height: 400px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  text-align: center;
  box-sizing: border-box;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}

.brand-logo h1 {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-main);
}

.brand-icon {
  width: 40px;
  height: 40px;
}

.brand-favicon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
}

.subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 22px;
  font-weight: 500;
}

.input-group {
  margin-bottom: 16px;
}

.entry-card input {
  height: 48px;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 16px;
}

.entry-card button {
  height: 48px;
  font-size: 15px;
  padding: 10px 20px;
  font-weight: 700;
}

.auth-links {
  margin-top: 12px;
  font-size: 14px;
}

.auth-links a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-links a:hover {
  text-decoration: underline;
}

.divider {
  display: flex;
  align-items: center;
  margin: 14px 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

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

.divider span {
  padding: 0 14px;
}

/* Auth Mode Selector (Sign In vs Sign Up) */
.auth-tabs {
  display: flex;
  background: var(--stat-box-bg);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid var(--stat-box-border);
}

.auth-tab {
  flex: 1;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Entry Footer Placement */
.entry-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

/* 2. Dashboard Layout (Compact Zoomed-Out 1360px Proportions) */
#dashboard {
  display: flex;
  flex-direction: column;
  width: 94%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 24px;
  box-sizing: border-box;
  gap: 14px;
  min-height: 100vh;
}

/* Dashboard Header */
#dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--header-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  background: var(--stat-box-bg);
  border: 1px solid var(--stat-box-border);
  border-radius: 20px;
  color: var(--color-success);
}

.sync-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.grid-row {
  display: grid;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

/* Row 1: Top Info Row (Greeting & Quote get more space, Clock & Weather compact 1-line width) */
.top-info-row {
  grid-template-columns: 1.35fr 0.8fr 0.8fr 1.35fr;
}

/* Row 2: Productivity Row (Tasks & Notes ONLY) */
.productivity-row {
  grid-template-columns: repeat(2, 1fr);
}

/* Row 3: Pomodoro Card & Activity History Card (More space for Activity, reduced Pomodoro width) */
.analytics-row {
  grid-template-columns: 1fr 1.6fr;
}

/* Row 4: Productivity Insights & Progress Graphs Card (Full Row Width) */
.graphs-row {
  grid-template-columns: 1fr;
}

/* Row 5: Upcoming Contests Feed (Full Row Width) */
.contests-row {
  grid-template-columns: 1fr;
}

/* Row 6: Social Row (GitHub, Codeforces, LeetCode, LinkedIn - 100% Equally Divided Strict Boundaries) */
.social-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  box-sizing: border-box;
}

/* Row 7: Codeforces Solved Difficulty Distribution Chart (Full Row Width) */
.cf-chart-row {
  grid-template-columns: 1fr;
}

/* Row 6: Bottom Row */
.bottom-row {
  grid-template-columns: 1fr;
}

/* Responsive Layout Breakpoints */
@media (max-width: 1024px) {
  #dashboard {
    width: 95%;
    padding: 16px 16px;
    gap: 16px;
  }
  .dashboard-grid, .grid-row {
    gap: 16px;
  }
  .top-info-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .productivity-row {
    grid-template-columns: 1fr;
  }
  .analytics-row {
    grid-template-columns: 1fr;
  }
  .social-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  #dashboard {
    width: 96%;
    padding: 14px 10px;
    gap: 14px;
  }
  .dashboard-grid, .grid-row {
    gap: 14px;
  }
  .top-info-row,
  .productivity-row,
  .analytics-row,
  .social-row,
  .graphs-row,
  .bottom-row {
    grid-template-columns: 1fr !important;
  }
}

#dashboard-footer {
  text-align: center;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  border-top: 1px solid var(--card-border);
  margin-top: 2px;
}

/* Settings Modal Backdrop & Compact Reduced-Height Modal Card */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 99999;
  padding: 24px 16px;
  overflow-y: auto;
}

.modal-card {
  width: 90%;
  max-width: 540px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 22px 26px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.close-btn {
  background: transparent;
  font-size: 24px;
  color: var(--text-muted);
  padding: 0;
  cursor: pointer;
  border: none;
}

.modal-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

