@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
:root{
  --base-clr: #11121a;
  --line-clr: #42434a;
  --hover-clr: #222533;
  --text-clr: #e6e6ef;
  --accent-clr: #5e63ff;
  --secondary-text-clr: #b0b3c1;
}

.lightmode {
  --base-clr: #f8f9fa;
  --line-clr: #a0a8b0;
  --hover-clr: #e8ecf1;
  --text-clr: #0f1419;
  --accent-clr: #5e63ff;
  --secondary-text-clr: #2c3e50;
}

*{
  margin: 0;
  padding: 0;
}
html{
  font-family: Poppins, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5rem;
}
body{
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--base-clr);
  color: var(--text-clr);
  display: grid;
  grid-template-columns: auto 1fr;
}
#sidebar{
  box-sizing: border-box;
  height: 100vh;
  width: 250px;
  padding: 5px 1em;
  background-color: var(--base-clr);
  border-right: 1px solid var(--line-clr);

  position: sticky;
  top: 0;
  align-self: start;
  transition: 300ms ease-in-out;
  overflow: hidden;
  text-wrap: nowrap;
}
#sidebar.close{
  padding: 5px;
  width: 60px;
}
#sidebar ul{
  list-style: none;
}
#sidebar > ul > li:first-child{
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

#sidebar > ul > li:first-child .logo{
  font-weight: 600;
}
#sidebar ul li.active span{
  color: var(--accent-clr);
}

#sidebar ul li.active a svg{
  fill: var(--accent-clr);
}

#sidebar ul li.active svg{
  fill: var(--accent-clr);
}

#sidebar a, #sidebar .dropdown-btn, #sidebar .logo{
  border-radius: .5em;
  padding: .85em;
  text-decoration: none;
  color: var(--text-clr);
  display: flex;
  align-items: center;
  gap: 1em;
}
.dropdown-btn{
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}
#sidebar svg{
  flex-shrink: 0;
  fill: var(--text-clr);
}
#sidebar a span, #sidebar .dropdown-btn span{
  flex-grow: 1;
}
#sidebar a:hover, #sidebar .dropdown-btn:hover{
  background-color: var(--hover-clr);
}
#sidebar .sub-menu{
  display: grid;
  grid-template-rows: 0fr;
  transition: 300ms ease-in-out;
}
#sidebar .sub-menu > div{
  overflow: hidden;
}
#sidebar .sub-menu.show{
  grid-template-rows: 1fr;
}
.dropdown-btn svg{
  transition: 200ms ease;
}
.rotate svg:last-child{
  rotate: 180deg;
}
#sidebar .sub-menu a{
  padding-left: 2em;
}

#toggle-btn, #login-btn, #logout-btn, #signup-button, #save-btn, #cancel-btn, #return-btn{
  margin-left: auto;
  padding: 1em;
  border: none;
  border-radius: .5em;
  background: none;
  cursor: pointer;
}
#login-btn {
  width: 300px;
  margin: 0 auto;
  display: block;
  font-size: 17px;
  background-color: var(--hover-clr);
  transition: all 300ms ease;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(94, 99, 255, 0);
  position: relative;
}
#toggle-btn, #login-btn, #logout-btn, #signup-button, #save-btn, #cancel-btn, #return-btn svg{
  transition: rotate 150ms ease;
}
#toggle-btn:hover, #logout-btn:hover, #signup-button:hover, #save-btn:hover, #cancel-btn:hover, #return-btn:hover{
  background-color: var(--hover-clr);
}
#login-btn:hover{
  background: linear-gradient(135deg, var(--accent-clr), #7c85ff);
  box-shadow: 0 8px 25px rgba(94, 99, 255, 0.3);
  transform: translateY(-2px);
}
#theme-switch {
  height: 50px;
  width: 50px;
  padding: 0;
  border-radius: 50%;
  background-color: var(--base-clr);
  border: 1px solid var(--line-clr);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease;
}

#theme-switch svg {
  width: 24px;
  height: 24px;
  fill: var(--text-clr);
  transition: all 200ms ease;
}

#theme-switch svg:last-child {
  display: none;
}

#theme-switch:hover {
  background-color: var(--hover-clr);
  border-color: var(--accent-clr);
  box-shadow: 0 4px 12px rgba(94, 99, 255, 0.2);
}

.lightmode #theme-switch svg:first-child {
  display: none;
}

.lightmode #theme-switch svg:last-child {
  display: block;
}
main{
  padding: min(30px, 7%);
}
main p{
  color: var(--secondary-text-clr);
  margin-top: 5px;
  margin-bottom: 15px;
}
.container{
  border: 1px solid var(--line-clr);
  border-radius: 1em;
  margin-bottom: 20px;
  padding: min(3em, 15%);

  h2, p { margin-top: 1em }
}

.login-container{
  width: 90%;
  max-width: 400px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line-clr);
  color: var(--text-clr);
  border-radius: 1em;
  padding: 2em;
  background-color: var(--base-clr);
  z-index: 1000;
  > form {
    width: 100%;
  }
  > .input-box,
  > form > .input-box {
    width: 100%;
    height: 50px;
    margin: 30px 0;
    background-color: var(--base-clr);
    position: relative;
  }
  > h1 {
    text-align: center;
  }
}

input[type=text],input[type=text]::placeholder{
 color:white;
}
input[type=email],input[type=email]::placeholder{
 color:white;
}
input[type=password],input[type=password]::placeholder{
 color:white;
}
.input-box input{
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  border: 2px solid var(--line-clr);
  border-radius: 40px;
  padding-left: 10px;
  z-index: 1;
}
.input-box input::placeholder{
  color: var(--secondary-text-clr);
}
.input-box svg {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  fill: var(--text-clr);
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    font-size: 14.5px;
    margin: -15px 0 15px;
    > a {
      color: var(--text-clr);
      text-decoration: none;
    }
    > a:hover {
      text-decoration: underline;
    }
}

form > .remember-forgot {
    display: flex;
    justify-content: space-between;
    font-size: 14.5px;
    margin: -15px 0 15px;
    > a {
      color: var(--text-clr);
      text-decoration: none;
    }
    > a:hover {
      text-decoration: underline;
    }
}

.register-link{
    color: var(--text-clr);
    font-size: 14.5px;
    text-align: center;
    margin-top: 20px;
    > p {
      > a {
      color: var(--secondary-text-clr);
      text-decoration: none;
      font-weight: 600;
      }
      > a:hover {
      text-decoration: underline;
      }
    }
  }
.login-container #login-btn {
  color: var(--text-clr);
}

.close-login {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--hover-clr);
  cursor: pointer;
  transition: 200ms ease;
}
.close-login:hover {
  background-color: var(--accent-clr);
}
.close-login svg {
  fill: var(--text-clr);
}

.profile-header {
  position: relative;
  margin-bottom: 100px;
}

.profile-header .profile-cover {
  height: 250px;
  background: linear-gradient(135deg, var(--accent-clr), #7c85ff);
  border-radius: 12px;
  margin-bottom: -60px;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-header .profile-info {
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 1;
  width: 100%;
}

.profile-header .profile-avatar {
  width: 140px;
  height: 140px;
  background-color: var(--base-clr);
  border: 4px solid var(--line-clr);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(94, 99, 255, 0.2);
  flex-shrink: 0;
  overflow: hidden;
  margin-right: 2em;
  margin-left: 2em;
}

.info-container {
  border: 1px solid var(--line-clr);
  border-radius: 1em;
  padding: 2em;
  background-color: var(--base-clr);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 2em 0 0;
  width: 100%;

  h2, p { margin-top: 1em }
  > .profile-details {
    padding-bottom: 10px;
    
    > h1 {
      font-size: 32px;
      color: var(--text-clr);
      margin: 0 0 5px 0;
      font-weight: 700;
    }
  }
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: var(--hover-clr);
  border: 1px solid var(--line-clr);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 300ms ease;
}

.stat-card:hover {
  border-color: var(--accent-clr);
  box-shadow: 0 4px 20px rgba(94, 99, 255, 0.15);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 32px;
}

.stat-content h3 {
  font-size: 14px;
  color: var(--secondary-text-clr);
  margin: 0 0 5px 0;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 24px;
  color: var(--accent-clr);
  margin: 0;
  font-weight: 700;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-clr);
}

.section-header h2 {
  font-size: 20px;
  color: var(--text-clr);
  margin: 0;
  font-weight: 600;
}

.edit-profile-btn,
.add-device-btn,
.setting-btn {
  background-color: var(--accent-clr);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
}

.add-device-btn,
.setting-btn {
  padding: 6px 12px;
  font-size: 12px;
}

.edit-profile-btn:hover,
.add-device-btn:hover,
.setting-btn:hover {
  background: linear-gradient(135deg, var(--accent-clr), #7c85ff);
  box-shadow: 0 4px 15px rgba(94, 99, 255, 0.3);
  transform: translateY(-1px);
}





/* Info Items */
.info-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-clr);
}

.info-item:last-child {
  border-bottom: none;
  margin-bottom: 15px;
  padding-bottom: 0;
}

.info-item label {
  display: block;
  font-size: 12px;
  color: var(--secondary-text-clr);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.info-item p {
  font-size: 16px;
  color: var(--text-clr);
  margin: 0;
  font-weight: 500;
}

.status-active {
  color: #4ade80 !important;
  font-weight: 600;
}

/* Device Items */
.device-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background-color: var(--base-clr);
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 200ms ease;
}

.device-item:hover {
  background-color: rgba(94, 99, 255, 0.05);
  border: 1px solid rgba(94, 99, 255, 0.2);
}

.device-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.device-info {
  flex: 1;
}

.device-info h3 {
  font-size: 15px;
  color: var(--text-clr);
  margin: 0 0 4px 0;
  font-weight: 600;
}

.device-info p {
  font-size: 13px;
  color: var(--secondary-text-clr);
  margin: 0;
}

.device-status {
  font-size: 13px;
  font-weight: 600;
  color: #4ade80;
  white-space: nowrap;
}

/* Activity Items */
.activity-item {
  padding: 15px;
  background-color: var(--base-clr);
  border-left: 3px solid var(--accent-clr);
  border-radius: 6px;
  margin-bottom: 12px;
}

.activity-time {
  font-size: 12px;
  color: var(--secondary-text-clr);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.activity-description strong {
  display: block;
  color: var(--text-clr);
  margin-bottom: 4px;
  font-weight: 600;
}

.activity-description p {
  font-size: 13px;
  color: var(--secondary-text-clr);
  margin: 0;
}

/* Setting Items */
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background-color: var(--base-clr);
  border-radius: 8px;
  margin-bottom: 12px;
  gap: 15px;
}

.setting-info {
  flex: 1;
}

.setting-info h3 {
  font-size: 15px;
  color: var(--text-clr);
  margin: 0 0 4px 0;
  font-weight: 600;
}

.setting-info p {
  font-size: 13px;
  color: var(--secondary-text-clr);
  margin: 0;
}

/* Preference Items */
.preference-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background-color: var(--base-clr);
  border-radius: 8px;
  margin-bottom: 12px;
  gap: 15px;
}

.preference-info {
  flex: 1;
}

.preference-info h3 {
  font-size: 15px;
  color: var(--text-clr);
  margin: 0 0 4px 0;
  font-weight: 600;
}

.preference-info p {
  font-size: 13px;
  color: var(--secondary-text-clr);
  margin: 0;
}

.preference-select {
  background-color: var(--hover-clr);
  color: var(--text-clr);
  border: 1px solid var(--line-clr);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 200ms ease;
}

.preference-select:hover {
  border-color: var(--accent-clr);
}

.preference-toggle {
  width: 50px;
  height: 28px;
  appearance: none;
  background-color: var(--line-clr);
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  transition: all 200ms ease;
  border: none;
}

.preference-toggle::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background-color: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all 200ms ease;
}

.preference-toggle:checked {
  background-color: var(--accent-clr);
}

.preference-toggle:checked::before {
  left: 24px;
}

/* Danger Zone */
.danger-zone {
  border: 1px solid rgba(239, 68, 68, 0.3);
  background-color: rgba(239, 68, 68, 0.05);
}

.danger-btn {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  background-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid #ef4444;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  font-size: 14px;
}

.danger-btn:hover {
  background-color: #ef4444;
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.danger-btn:last-child {
  margin-bottom: 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.profile-column-left,
.profile-column-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-section {
  border: 1px solid var(--line-clr);
  border-radius: 12px;
  padding: 20px;
  background-color: var(--hover-clr);
}

@media(max-width: 800px){
  body{
    grid-template-columns: 1fr;
  }
  main{
    padding: 2em 1em 60px 1em;
  }
  .container{
    border: none;
    padding: 0;
  }
  #sidebar{
    height: 60px;
    width: 100%;
    border-right: none;
    border-top: 1px solid var(--line-clr);
    padding: 0;
    position: fixed;
    top: unset;
    bottom: 0;
  }

  #sidebar > ul{
    padding: 0;
    display: grid;
    grid-auto-columns: 60px;
    grid-auto-flow: column;
    align-items: center;
    overflow-x: scroll;
  }

  #sidebar ul li{
    height: 100%;
  }

  #sidebar ul a, #sidebar ul .dropdown-btn{
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 0;
    justify-content: center;
  }

  #sidebar ul li span, #sidebar ul li:first-child, #sidebar .dropdown-btn svg:last-child{
    display: none;
  }

  #sidebar ul li .sub-menu.show{
    position: fixed;
    bottom: 60px;
    left: 0;
    box-sizing: border-box;
    height: 60px;
    width: 100%;
    background-color: var(--hover-clr);
    border-top: 1px solid var(--line-clr);
    display: flex;
    justify-content: center;
  }

  #sidebar ul li .sub-menu.show > div{
    overflow-x: auto;
  }

  #sidebar ul li .sub-menu.show li{
    display: inline-flex;
  }

  #sidebar ul li .sub-menu.show a{
    box-sizing: border-box;
    padding: 1em;
    width: auto;
    justify-content: center;
  }

  .profile-cover {
    height: 180px;
    margin-bottom: -50px;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
  }

  .profile-avatar svg {
    width: 70px;
    height: 70px;
  }

  .profile-details h1 {
    font-size: 24px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .profile-stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    flex-direction: column;
    text-align: center;
  }

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

  .setting-item,
  .preference-item,
  .device-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .preference-select,
  .setting-btn {
    width: 100%;
  }
}