@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: "Poppins", sans-serif;
}

/* Phone Frame */
.iphone-frame {
  position: relative;
  width: 390px;
  height: 810px;
  border: 15px solid #222;
  border-radius: 60px;
  background: #111;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
}

/* Power & Volume Buttons */
.volume-button-up, .volume-button-down {
  position: absolute;
  left: -20px;
  width: 7px;
  height: 70px;
  background-color: #555;
  border-radius: 10px;
  z-index: 1;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.volume-button-up {
  top: 150px;
}

.volume-button-down {
  top: 230px;
}

.volume-button-up:hover, .volume-button-down:hover {
  background-color: #777;
}

.volume-button-up:active, .volume-button-down:active {
  background-color: #333;
}

.volume-display {
  position: absolute;
  top: 20%;
  font-size: 20px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 10px;
  border-radius: 5px;
  z-index: 100;
  transition: opacity 0.2s ease;
  opacity: 0;
}

.power-button {
  position: absolute;
  left: -20px;
  margin-bottom: 80px;
  width: 7px;
  height: 50px;
  background-color: #555;
  border-radius: 10px;
  z-index: 1;
  cursor: pointer;
}

/* Power & Volume Buttons */
/* Main iPhone layout */

.iphone {
  width: 360px;
  height: 780px;
  border-radius: 50px;
  background-image: url("images/wallpaper.png");
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  opacity: 0;
  transition: all .3s ease;
}

.iphone.active {
  opacity: 1;
}

/* Date & Time */

.date-time {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  text-align: center;
  z-index: 100;
  width: 100%;
}

.date {
  font-size: 20px;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
}

.time {
  font-size: 5rem;
  font-weight: bold;
  margin-left: 2rem;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
}

.ampm {
  font-size: 15px;
  color: #fff;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
  margin-left: -1rem;
}

/* End Date & Time */
/* I-phone Notch */

.notch {
  width: 150px;
  height: 40px;
  background-color: #000;
  border-radius: 50px;
  margin: 10px auto;
  position: relative;
  transition: 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.notch:hover {
  width: 300px;
  height: 80px;
}

.speaker {
  width: 60px;
  height: 4px;
  background-color: #fff;
  border-radius: 10px;
  position: absolute;
  left: calc(50% - 30px);
  top: 12px;
}

/* Incoming call */

.incoming-call {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.8);
  width: 100%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.notch:hover .incoming-call {
  opacity: 1;
}

.caller-image {
  border-radius: 50%;
  width: 50px;
  height: 50px;
  border: 3px solid #fff;
  margin-bottom: 5px;
}

.caller-name {
  font-size: 16px;
  margin-bottom: 10px;
  text-align: center;
  margin: 1rem;
}

.call-buttons {
  display: flex;
  gap: 10px;
}

.call-receive,
.call-decline {
  background-color: #28a745;
  color: #fff;
  border: none;
  padding: 10px 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.call-decline {
  background-color: #dc3545;
}

.call-receive:hover {
  background-color: #218838;
}

.call-decline:hover {
  background-color: #c82333;
}

/* End Incoming call */
/* End I-phone Notch */
/* Screen Design */

.screen {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* End Screen Design */
/* Apps Design */

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
  padding: 20px 0;
  z-index: 1000;
  margin-top: 155%;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-shadow: 0px 1px 5px rgba(0, 0, 0, 0.7);
}

.app img {
  width: 50px;
  height: 50px;
  cursor: pointer;
  border-radius: 15px;
}

.app span {
  margin-top: 5px;
  font-size: 12px;
}

/* End Apps Design */
/* App Drawer */

.home-bar {
  width: 100px;
  height: 5px;
  background-color: #fff;
  border-radius: 50px;
  margin: 20px auto;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* End App Drawer */
/* Settings App Design */

.settings-app {
  width: 360px;
  height: 780px;
  padding: 20px;
  background: #f0f0f5;
  border-radius: 50px;
  display: none;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.settings-app::-webkit-scrollbar {
  display: none;
}

h1 {
  font-size: 24px;
  margin-bottom: 20px;
}

.search-bar {
  position: relative;
  padding: 10px 0;
}

.search-input {
  width: 100%;
  padding: 10px 40px;
  background: #ddd;
  border-radius: 20px;
  border: none;
  outline: none;
}

.search-icon, .voice-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: gray;
}

.search-icon {
  left: 10px;
}

.voice-icon {
  right: 10px;
}

.profile-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 20px;
}

.profile-image {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 15px;
}

.profile-name{
  font-weight: bold;
}

.profile-details{
  font-size: 10px;
  color: #aaa;
}

.profile-info {
  flex: 1;
}

.setting-container {
  max-height: 600px;
  overflow-y: auto;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 10px;
}

.setting-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.setting-right span{
  color: #bbb;
}

.setting-left i {
  font-size: 20px;
  color: #007BFF;
}

.setting-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-item label {
  font-size: 16px;
}
#dark-icon{
  color: #fff;
  background: #000;
  border-radius: 5px;
  padding: .4rem;
  margin: .1rem .8rem .1rem .1rem;'
}
/* Toggle Switch */

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.toggle-switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  background-color: #fff;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #007BFF;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* End Toggle Switch */

.setting-item i.fas, .profile-section i.fas {
  font-size: 16px;
  color: #bbb;
}

#saveBtn {
  width: 100%;
  text-align: center;
  padding: 10px;
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-size: 16px;
  transition: 0.3s ease;
  margin-top: 15px;
}

#saveBtn:hover {
  background-color: #0056b3;
}

/* Dark mode styles for settings-app */
.settings-app.dark-mode {
  background: #121212;
}

.settings-app.dark-mode h1 {
  color: #fff;
}

.settings-app.dark-mode .setting-item,
.messages-list.dark-mode, .messages-app.dark-mode{
  background: #000;
  color: #fff;
}

.settings-app.dark-mode #dark-icon {
  background: #fff;
  color: #000;
}

.messages-list.dark-mode .message-name{
  color: #000;
}

.messages-app.dark-mode .message-input{
  background: #000;
}

.messages-app.dark-mode .top-bar,
.messages-app.dark-mode .message-input-bar{
  background: #1e1e1e;
}

/* End Settings App Design */
/* Messages App */
/* Messages list */

.messages-list {
  width: 360px;
  height: 100%;
  padding: 20px;
  background: #fff;
  border-radius: 50px;
  display: none;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.message-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}
.messages-list h1 {
    position: relative; /* Set positioning context for the close-message */
}

.close-message {
    position: absolute;
    top: 0;
    right: 0;
    cursor: pointer;
}

.profile-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.message-info {
  flex-grow: 1;
  margin-left: 10px;
}

.message-name {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
}

.message-snippet {
  font-size: 14px;
  color: #888;
}

.message-time {
  font-size: 12px;
  color: #bbb;
}

/* Messages App */
.messages-app {
  width: 360px;
  height: 780px;
  background: #f0f0f5;
  border-radius: 50px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.back-btn{
  background: none;
  border: none;
  font-size: 15px;
  color: #007BFF;
  margin-left: 1rem;
}

.top-icons i {
  font-size: 20px;
  color: #007BFF;
  margin: .2rem;
  cursor: pointer;
}

.contact-info {
  text-align: center;
}

.contact-name {
  font-size: 18px;
  font-weight: bold;
}

.status {
  font-size: 12px;
  color: green;
}

.messages-area {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
}

.message {
  margin-bottom: 15px;
  display: flex;
}

.message.sent {
  justify-content: flex-end;
}

.message.received {
  justify-content: flex-start;
}

.bubble {
  padding: 10px 15px;
  border-radius: 20px;
  max-width: 60%;
  font-size: 14px;
  line-height: 1.4;
}

.message.sent .bubble {
  background-color: #007aff;
  color: white;
  border-radius: 20px 20px 0 20px;
}

.message.received .bubble {
  background-color: #fff;
  border: 1px solid #d1d1d6;
  color: black;
  border-radius: 20px 20px 20px 0;
}

.message-input-bar {
  display: flex;
  align-items: center;
  padding: 15px;
  background: #fff;
  margin-top: 30rem;
  box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
}

.message-input {
  flex-grow: 1;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #d1d1d6;
  border-radius: 20px;
  margin: 0 10px;
  outline: none;
}

.send-btn, .media-btn {
  font-size: 20px;
  color: #007aff;
  background: none;
  border: none;
  cursor: pointer;
}