/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
  margin-top: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* Layout Components */
header {
  background-color: #1e293b;
  color: white;
  padding: 1rem 0;
}

header h1 {
  margin: 0;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header > nav ul {
  display: flex;
  list-style: none;
}

header > nav ul li {
  margin-left: 1.5rem;
}

header > nav ul li a {
  color: white;
  text-decoration: none;
}

header > nav ul li a:hover {
  text-decoration: underline;
}

main {
  padding: 2rem 0;
  min-height: calc(100vh - 140px);
}

footer {
  background-color: #bec7d1;
  padding: 1.5rem 0;
  text-align: center;
  color: #011d46;
}

/* Components */
.card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  background-color: #2563eb;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
}

.btn:hover {
  background-color: #1d4ed8;
  text-decoration: none;
}

.btn-outline {
  background-color: transparent;
  color: #2563eb;
  border: 1px solid #2563eb;
}

.btn-outline:hover {
  background-color: #2563eb;
  color: white;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

.btn-danger {
  background-color: #ef4444;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #4ade80;
}

.alert-error {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #f87171;
}

/* Forms */
.form-container {
  max-width: 500px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.full-width {
  grid-column: span 2;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.form-help {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.required {
  color: #ef4444;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 0;
  max-width: 800px;
  margin: 0 auto;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  color: #64748b;
  margin-bottom: 2rem;
}

.button-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Tabs */
.tabs {
  margin-bottom: 2rem;
}

/* .tab-header {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1rem;
  flex-wrap: wrap;
} */
.tab-header {
  display: flex;
  flex-wrap: wrap;         /* Allow buttons to wrap */
  gap: 0.75rem;            /* Space between buttons */
  justify-content: center; /* Center buttons horizontally */
  margin-bottom: 1rem;
}
/* 
.tab-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #64748b;
  border-bottom: 2px solid transparent;
} */
.tab-btn {
  flex: 1 1 calc(20% - 0.75rem); 
  padding: 0.75rem 1rem;
  border: none;
  background-color: #e2e8f0;
  color: #1e293b;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: center;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}
.tab-btn.active,
.tab-btn:hover {
  background-color: #1e40af;
  color: #fff;
}
/* 
.tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
} */

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Nested Tabs */
.nested-tabs {
  margin-top: 1.5rem;
}

.nested-tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.nested-tab-pane {
  display: none;
  padding-top: 1rem;
}

.nested-tab-pane.active {
  display: block;
}

/* Profile Styles */
.profile-container {
  display: flex;
  flex-direction: column;
}
.error-border {
  border: 2px solid red !important;
}
.home-section {
  padding: 3rem 0;
}

/* Forgot password link */
.forgot-password {
  text-align: center;
  margin-top: -10px;
  margin-bottom: 15px;
}

.forgot-password a {
  color: #0056b3;
  text-decoration: none;
  font-size: 0.9em;
}

.forgot-password a:hover {
  text-decoration: underline;
}
@media (min-width: 768px) {
  .profile-container {
    flex-direction: row;
    gap: 2rem;
  }
}

.profile-image {
  flex-shrink: 0;
  margin-bottom: 1.5rem;
}

.profile-image img {
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.profile-info,
.profile-details {
  flex: 1;
}

.profile-section {
  margin-bottom: 1.5rem;
}

.profile-section h4 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #64748b;
  margin-bottom: 1.5rem;
}

.profile-picture-upload {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.preview-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.profile-preview {
  max-width: 200px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin: 1rem 0;
}

/* Faculty Directory */
.directory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.faculty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.faculty-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.faculty-image {
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.faculty-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.faculty-content {
  padding: 1.5rem;
  flex: 1;
}

.faculty-title,
.faculty-department {
  color: #64748b;
  margin-bottom: 0.5rem;
}

.faculty-bio {
  font-size: 0.875rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.faculty-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faculty-actions {
  display: flex;
  gap: 0.5rem;
}

.faculty-email {
  font-size: 0.875rem;
  color: #64748b;
}

/* Profile Page */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.profile-contact {
  margin-top: 1rem;
}

.not-found {
  text-align: center;
  padding: 3rem 0;
}

/* CV Management */
.current-cv {
  margin-bottom: 1.5rem;
}

.delete-cv-form {
  margin-top: 1rem;
}

.cv-download {
  margin-top: 1rem;
  text-align: center;
}

/* Publication Lists */
.publication-list,
.conference-list,
.award-list,
.supervision-list {
  list-style-type: none;
  padding-left: 0;
}

.publication-list li,
.conference-list li,
.award-list li,
.supervision-list li {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
}

.publication-list li:before,
.conference-list li:before,
.award-list li:before,
.supervision-list li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: #2563eb;
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.data-table th {
  font-weight: 600;
  background-color: #f8fafc;
}

.data-table tr:hover {
  background-color: #f1f5f9;
}

.inline-form {
  display: inline;
}

/* Select dropdown styling */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tab-header {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
  }

  .tab-btn {
    padding: 0.75rem 1rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .full-width {
    grid-column: span 1;
  }

  .faculty-actions {
    flex-direction: column;
  }
}

/* Text utilities */
.text-center {
  text-align: center;
}

.text-muted {
  color: #64748b;
}

/* No results */
.no-results {
  text-align: center;
  padding: 2rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Current picture */
.current-picture {
  margin-bottom: 1.5rem;
}

.current-picture img {
  max-width: 200px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-top: 0.5rem;
}


.header-container {
  display: flex;
  flex-direction: column;
  /* Stack heading + nav on mobile */
  align-items: center;
  /* Center content horizontally */
  gap: 1rem;
  padding: 1rem;
  background-color: #1e293b;
  color: #fff;
  text-align: center;
}

.header-container h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #fff;
}

/* Navigation list */
.nav-user {
  display: flex;
  flex-direction: column;
  /* Stack Welcome + Logout vertically */
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-user span {
  font-weight: 500;
  color: #f1f5f9;
}

.nav-user .btn {
  background-color: #0ea5e9;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  text-decoration: none;
}
/* Forgot password link */
.forgot-password {
  text-align: right;
  margin-top: 5px;
  margin-bottom: 1px;
}

.forgot-password a {
  color: #0056b3;
  text-decoration: none;
  font-size: 0.9em;
}

.forgot-password a:hover {
  text-decoration: underline;
}

/* On desktop: show heading and nav side-by-side */
@media (min-width: 768px) {
  .header-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: center;
  }

  .nav-user {
    flex-direction: row;
    justify-content: flex-end;
  }

  .tab-btn {
    flex: 1 1 100%; /* 3 per row on tablet */
    font-size: 0.85rem;
  }

}

@media (min-width: 1024px) {
  .tab-btn {
    flex: 1 1 calc(20% - 0.75rem); ; /* 4 per row on desktop */
  }
}
@media (max-width: 480px) {
  .tab-btn {
    flex: 1 1 100%;
    /* One button per row on very small screens */
  }
}