/* set some global attributes */
* {
  font-size: 14px;
  font-family: "Poppins", sans-serif;
  box-sizing: border-box;
  --primary-colour: rgb(1, 52, 1);
  --hover-green: rgb(10, 70, 10);
  --bg-light: #f4f7f4;
  --text-main: #2d2d2d;
}

/* --- taking back control of my styles after bootstrap implementation - start --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* fixing the font-family on hx */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Poppins", sans-serif !important;
}

.signup-login a {
  color: var(--primary-colour);
  text-decoration: none;
  font-family: inherit;
  font-size: inherit;
}

.signup-login a:hover {
  color: var(--hover-green);
  text-decoration: underline;
}

/* --- taking back control of my styles after bootstrap implementation - end --- */

/* --- html element general styling - start ---*/
body {
  background-color: var(--bg-light);
  color: var(--text-main);
  margin: 0;
}

section {
  margin: 0;
  padding: 10px 0;
}

/* --- entry forms css - start --- */
.form-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
}

.form-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 750px;
  gap: 20px;
}

.input-form {
  background: #ffffff;
  border-top: 5px solid var(--primary-colour);
  border-radius: 5px;
  box-shadow: 0 10px 30px rgba(0, 52, 0, 0.08);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

.form-item {
  position: relative;
  margin-bottom: 1.5rem;
  width: 100%;
}

.form-item input,
.form-item textarea {
  width: 100%;
  padding: 20px 10px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  background: white;
  box-sizing: border-box;
}

.form-item label {
  position: absolute;
  left: 12px;
  top: 18px;
  color: var(--text-main);
  transition: all 0.3s ease;
  pointer-events: none;
}

.form-item input:focus {
  border-color: var(--primary-colour);
}

.form-item input:focus + label {
  color: var(--primary-colour);
}

.form-item input:focus + label,
.form-item textarea:focus + label,
.form-item input:not(:placeholder-shown) + label,
.form-item textarea:not(:placeholder-shown) + label {
  top: 6px;
  font-size: 12px;
  color: rgb(1, 52, 1);
}

.form-item span.display-value + label {
  top: 6px;
  font-size: 12px;
  color: var(--text-main);
}

.input-error {
  color: #e74c3c;
  font-size: 10px;
  display: block;
  margin-top: 5px;
}

.profile-item {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.profile-input {
  position: relative;
  flex-grow: 1;
}

.privacy-toggle {
  min-width: 80px;
  display: flex;
  align-items: center;
}

.privacy-checkbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  color: var(--text-main);
  cursor: pointer;
}

.privacy-checkbox input {
  width: 18x !important;
  height: 18px;
  margin-bottom: 4px;
}

.hidden-checkbox {
  position: absolute;
  opacity: 0;
  height: 0;
  width: 0;
}

.label-toggle {
  display: inline-block;
  padding: 8px 15px;
  background-color: #e0e0e0;
  color: #666;
  border-radius: 20px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-width: 70px;
  position: static !important;
  pointer-events: auto !important;
}

.hidden-checkbox:checked + .label-toggle {
  background-color: var(--primary-colour);
  color: white;
}

.label-toggle:hover {
  filter: brightness(0.9);
}

.privacy-status::after {
  content: "Private";
}

.hidden-checkbox:checked + .label-toggle .privacy-status::after {
  content: "Public";
}

.display-value {
  display: block;
  padding: 20px 10px 10px;
  font-size: 16px;
  color: var(--text-main);
  border-bottom: 1px solid #eee;
  width: 100%;
}

.display-value.private {
  color: var(--text-main);
  font-style: italic;
}

.form-item span + label {
  top: 6px;
  font-size: 12px;
  color: var(--text-main);
}

#form-submit {
  padding: 10px;
  margin-top: 5px;
  background-color: var(--primary-colour);
  color: #ffffff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition:
    background 0.3s ease,
    transform 0.2s ease;
}

#login-submit:hover {
  background-color: var(--primary-colour);
  transform: translate(-1px);
}

.signupLogin {
  text-align: center;
}

.box-error {
  background: #fee;
  color: #b00;
  padding: 15px;
  border: 1px solid #b00;
  margin: 20px;
  border-radius: 5px;
}

/* enhanced styling for the bootstrap empty field validation */
.empty-field-validate {
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

/* replication of bootsrap invalid-feedback for php errors */
.php-invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #dc3545;
}

/* --- entry forms css - end --- */

/* --- myprofile header css - start ---*/
.profile-user-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0 20px 0;
  width: 100%;
}

.profile-img-wrapper {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--primary-colour);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 15px;
}

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

.profile-username h1 {
  font-size: 1.8rem;
  color: var(--text-main);
  margin: 0px;
}

.update-profile-img-container {
  margin: 10px 0;
}

.update-photo-btn,
.follow-btn {
  background-color: var(--primary-colour);
  color: white;
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: opacity 0.2s;
  border: none;
  box-shadow: none;
  outline: none;
}

.update-photo-btn:hover,
.follow-btn:hover {
  opacity: 0.8;
}

/* --- myprofile header css - end ---*/

/* --- feed posts css - start --- */
.feed-section,
.logout-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  gap: 15px;
  margin-top: 10px !important;
  padding-top: 0;
}

.logout-section {
  min-height: 80vh;
}

.post-card {
  width: 100%;
  max-width: 750px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-top: 5px solid var(--primary-colour);
  border-radius: 5px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 10px;
}

.post-author {
  color: var(--primary-colour);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.post-author:hover {
  text-decoration: underline;
}

.post-time {
  font-size: 0.85rem;
  color: #888;
}

.post-body p {
  line-height: 1.6;
  color: var(--text-main);
  word-wrap: break-word;
  margin: 10px 0;
}

.post-img img {
  width: 100%;
  height: auto;
  border-radius: 5px;
  margin-top: 15px;
  display: block;
}

.empty-post {
  text-align: center;
  padding: 40px;
  color: #666;
  font-style: italic;
}

.post-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-top: 1px solid #eee;
  margin-top: 10px;
}

.control-btn {
  background: none;
  border: none;
  color: var(--primary-colour);
  cursor: pointer;
  margin-right: 15px;
  font-size: 0.7rem;
}

.delete-btn {
  background-color: #c0392b;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.7rem;
  cursor: pointer;
  box-shadow: none; /* there was a weird halow around the buttons so I added this and the halo went  */
}

.like-btn {
  transition: all 0.2s ease;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  color: var(--text-main);
}

.heart-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* default: show empty heart, hide filled */
.heart-empty {
  display: block !important;
}
.heart-filled {
  display: none !important;
}

/* liked state: swap hearts */
.active-liked .heart-empty {
  display: none !important;
}
.active-liked .heart-filled {
  display: block !important;
}
.active-liked {
  color: #e74c3c;
}

.like-count {
  font-size: 0.85rem;
  color: #666;
  vertical-align: middle;
}

.like-btn:hover {
  opacity: 0.7;
  transform: translateY(-1px);
}

.interactions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- feed posts css - end */

/* --- connections css - start */
.central-wrapper {
  max-width: 750px;
  margin: 0 auto;
  padding: 20px;
}

.connections-group {
  background: #ffffff;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 5px;
  border-top: 5px solid var(--primary-colour);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.user-pic {
  display: flex;
  align-items: center;
}

.profile-thumbnail {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  margin-right: 15px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #ddd;
}

.profile-name {
  text-decoration: none;
  font-weight: bold;
  color: #333;
}

/* --- connections css - end */

/* --- header/ nav css - start ---  */

#header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: var(--primary-colour);
  position: relative;
}

#logo img {
  height: 30px;
}

.logo-link,
.logo-link:hover,
.logo-link:visited,
.logo-link:active {
  text-decoration: none;
  color: inherit;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

#menu-toggle {
  display: none;
}

#menu-toggle:checked ~ #menu {
  display: flex;
}

.menu-item {
  font-size: 24px;
  cursor: pointer;
  color: white;
}

.menu-icon {
  font-size: 24px;
  cursor: pointer;
  color: white;
  display: block;
  align-items: center;
}

#menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--primary-colour);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.tab-button {
  display: inline-block;
  white-space: nowrap;
  text-decoration: none;
  width: 100%;
  text-align: left;
  padding: 10px 15px;
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.5s ease;
}

.active-tab {
  background-color: white;
  color: var(--primary-colour);
  transition: all 0.5s ease;
}

.tab-button:hover:not(.active-tab) {
  background-color: rgba(1, 52, 1, 0.1);
}

/* --- header/ nav css - end ---  */

/* i think these are overhang from building on the first iteration of the site - don't have time to remove - start */
#heroContainer {
  background-image: url(profileHero.png);
  background-size: cover;
  background-position: center;
  height: 200px;
  display: flex;
  justify-content: center;
}

.profileImgName {
  display: flex;
  flex-direction: column;
  align-self: flex-end;
}

.profileImage {
  height: 100px;
  width: 100px;
  border-radius: 50%;
  border: solid darkblue 3px;
  overflow: hidden;
  align-self: center;
}

.profileName {
  font-weight: bold;
  font-size: 250%;
  text-align: center;
  color: white;
}

/* I did this to target the image as it kept spilling outside the div */
.profileImage img {
  height: 100%;
  width: 100%;
}

#leftPanel,
#rightPanel {
  display: none;
}

/* i think these are overhang from building on the first iteration of the site - don't have time to remove - start */

nav {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

#content {
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#info {
  padding: 10px;
}

.connectionList {
  display: flex;
  justify-content: space-around;
  padding: 50px;
}

.connection {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#connectionImg {
  width: 50px;
  height: 50px;
  border: solid darkblue 3px;
  border-radius: 50%;
  overflow: hidden;
}

#connectionImg img {
  width: 100%;
  height: 100%;
}

#centrePanel {
  padding: 5px;
}

.feedItem {
  margin-top: 20px;
  border-top: 1px solid black;
}

.feedHeader {
  margin: 5px 0px 5px 0px;
}

.feedMedia img,
.feedmedia video {
  max-width: 100%;
  height: auto;
}

#footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-colour);
  color: white;
  height: 20vh;
  width: 100%;
  margin-top: 50px;
}

.footer-item p {
  color: white;
  margin: 5px 0;
  font-size: 1rem;
}

.socials {
  display: flex;
  flex-direction: row;
  justify-content: center;
  justify-content: space-around;
  margin: 25px;
}

.socialicon img {
  height: 30px;
}

.activeTab {
  display: block;
}

.inactiveTab {
  display: none;
}

/* i think these are overhang from building on the first iteration of the site - don't have time to remove - end */

/* responsive adjustments for bigger screens */
@media (min-width: 768px) {
  .menu-icon {
    display: none;
  }

  #menu {
    display: flex;
    flex-direction: row;
    position: static;
    width: auto;
    background: transparent;
    box-shadow: none;
  }

  .active-tab {
    border-bottom: 4px solid white;
    background-color: var(--primary-colour);
    color: white;
    transition: all 0.5s ease;
  }

  .tabButton {
    width: auto;
    text-align: center;
  }

  #content {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
  }

  #leftPanel,
  #rightPanel {
    display: block;
    grid-column: span 3;
  }

  #centrePanel {
    grid-column: span 6;
  }
}
