/* =========================
   BASE & RESET
   ========================= */
* {
  margin: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

:root {
  --bg: #ffffff;
  --card: #ffffff;
  --text: #111111;
  --muted: #666666;
  --border: #e6e6e6;
  --accent: #2f6fff;
  --accent-hover: #1f5be0;
  --primary: #4a90e2;
}

body {
  color: var(--text);
  background: var(--bg);
  margin: 0;
  font-family: Arial, sans-serif;
}

main {
  padding: 7px;
}

/* =========================
   BUTTONS & CONTROLS
   ========================= */
button {
  background: #2f6fff;
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-hover);
}

input, select, textarea {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  box-sizing: border-box;
}

/* =========================
   HEADER & NAVIGATION
   ========================= */
header {
  background-color: var(--primary);
  padding: 4px;
  color: white;
  position: relative;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin: 0;
}

.logo {
  font-size: 1.5rem;
  padding-left: 1rem;
  padding-top: 15px;
  padding-bottom: 15px;
  cursor: pointer;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: white;
  font-weight: bold;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #d1eaff;
}

#user-status {
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
}

#logout-btn a {
  color: #ffdddd;
}

/* Nav Profile & Dropdown */
.profile-menu {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
  padding-right: 2px;
  cursor: pointer;
  font-weight: bold;
  color: white;
}

.nav-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid #444;
  transition: 0.2s ease;
}

.nav-avatar:hover {
  transform: scale(1.05);
  border-color: #777;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #1e1e1e;
  border-radius: 8px;
  display: none;
  flex-direction: column;
  min-width: 150px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 9999;
}

.dropdown-menu a,
.dropdown-menu button {
  padding: 10px;
  color: white;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
  background: #333;
}

.profile-menu:hover .dropdown-menu {
  display: flex;
}

/* =========================
   GENERIC SECTIONS & HERO
   ========================= */
.hero {
  padding: 3rem 2rem;
  text-align: center;
}

.tools-section {
  padding: 2rem;
  text-align: center;
}

.about-section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: var(--card);
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  text-align: center;
}

.about-section h2 {
  margin-bottom: 1rem;
  font-size: 2rem;
  color: var(--primary);
}

.about-section p {
  margin: 1rem 0;
  line-height: 1.6;
}

/* Tool Grids & Tiles */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.tool-tile {
  display: block;
  background-color: #e1ecf9;
  padding: 2rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: bold;
  transition: transform 0.2s, background-color 0.3s;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tool-tile:hover {
  background-color: #d4e7fb;
  transform: translateY(-5px);
}

.tool-tile.with-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
}

.tool-tile img {
  width: 100%;
  max-width: 150px;
  height: auto;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* =========================
   AUTH & FORMS
   ========================= */
.auth-box {
  max-width: 400px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #e1ecf9;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  text-align: center;
}

.auth-box input,
.auth-box textarea {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.auth-box button {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  background: #4a90e2;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.auth-box button:hover {
  background: #357bd8;
}

/* =========================
   TIMETABLE & CLASSES UI
   ========================= */
.timetable-wrapper {
  max-width: 1100px;
  margin: auto;
  padding: 20px;
}

.timetable-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.timetable-header h2 {
  margin: 0;
  font-size: 22px;
  color: var(--text);
}

.timetable-actions {
  display: flex;
  gap: 10px;
}

.timetable-link {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  transition: 0.2s;
}

.timetable-link:hover {
  border-color: var(--accent);
}

.timetable-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.timetable-slot, .cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  min-height: 95px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.timetable-slot:hover, .cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.10);
  border-color: var(--accent);
}

.slot-meta {
  font-size: 12px;
  color: var(--muted);
}

.slot-subject {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.slot-info {
  font-size: 13px;
  color: #333;
}

.slot-friends {
  display: flex;
  margin-top: 6px;
}

.friend-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  margin-left: -6px;
  border: 2px solid #fff;
  object-fit: cover;
}

/* =========================
   PROFILE & WALL LAYOUT
   ========================= */
.profile-layout {
  display: flex;
  gap: 25px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: flex-start;
}

.profile-left {
  width: 340px;
  flex-shrink: 0;
}

.profile-right {
  flex: 1;
}

.profile-box {
  background: white;
  color: black;
  border-radius: 12px;
  padding: 18px;
  margin-top: 15px;
  border: 1px solid var(--border);
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  text-align: left;
}

.profile-box h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.profile-box p {
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

.status-box { border-left: 4px solid #4f8cff; }
.about-box { border-left: 4px solid #4CAF50; }
.friends-box { border-left: 4px solid #ff9800; }

.profile-card-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 25px;
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

.avatar-big {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #555;
  margin-bottom: 15px;
}

.friend-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin: 8px 0;
  background: #f9f9f9;
  border-radius: 10px;
  cursor: pointer;
  color: black;
  transition: background 0.2s;
}

.friend-profile-card:hover {
  background: #e9e9e9;
}

.friend-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

/* Wall Posts */
.wall-post {
  background: #f7f7f7;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.wall-date {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 6px;
}

#newPost, .newpost {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  resize: vertical;
  font-family: inherit;
}

.edit-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* =========================
   FOOTER & MISC
   ========================= */
footer {
  text-align: center;
  padding: 1rem;
  background-color: #e6f0ff;
  margin-top: 2rem;
}

.Credits, .Privacy, .licredits {
  text-decoration: none;
  color: black;
  text-align: center;
}

.licredits:hover {
  text-decoration: underline;
}

.smfgs {
  width: 540px;
  border: 5px solid #2d3536;
  padding: 5px;
  margin: auto;
  background-color: #6a7273;
  color: #c4cccc;
  text-align: center;
}

/* =========================
   RESPONSIVE BREAKPOINTS
   ========================= */
@media (max-width: 900px) {
  .timetable-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .profile-layout {
    flex-direction: column;
  }

  .profile-left {
    width: 100%;
  }
}

@media (max-width: 500px) {
  .timetable-grid {
    grid-template-columns: 1fr;
  }
}