/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #ffffff;
  color: #222;
  transition: background-color 0.3s, color 0.3s;
  padding-bottom: 3rem;
}

/* Dark mode */
body.dark {
  background-color: #121212;
  color: #f0f0f0;
  
}

header {
  background-color: #f9f9f9;
  color: #222;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s, color 0.3s;
}

header h1 {
  font-size: 1.8rem;
}
#image{
    display: flex;
    align-items: center;
    gap: 5px;
    color: #111;
    margin-left: 10%;
    font-size: 1.5rem;
    cursor: pointer;
}
body.dark #image{
  color: white;
  font-size: 1.5rem;
}
#himg {
    height: 50px; 
    width: 50px;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
}

nav button {
  animation: slideIn 0.5s ease-in-out;
  transition: transform 0.3s ease;
  margin-left: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background-color: #faf8f8;
  border: 1px solid;
  color: rgb(7, 7, 7);
  cursor: pointer;
  transition: background-color 0.3s;
}

nav button:hover,#profile button:hover{ 
  background-color: #777;
  color: rgb(255, 252, 252);
}
body.dark button{
  color: white;
  background-color: #353333;
  border: 1px solid white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);

}
body.dark button:hover,body.dark #profile>div>button:hover{
  background-color: rgb(255, 252, 252);
  color: #080808;
}

main {
  padding: 1.5rem;
}

h2 {
  margin-bottom: 1rem;
}

/* Meme Feed Grid */
.feed-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 1rem;
}



/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .meme-card {
    width: 90%;
  }
}



body.dark header {
  background-color: #1a1a1a;
  color: #f0f0f0;
}

body.dark .meme-card {
  background-color: #1e1e1e;
}

.meme-card {
  animation: slideIn 0.5s ease-in-out;
  transition: transform 0.3s ease;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.meme-card:hover {
  transform: scale(1.02);
}

.meme-card img {
  width: 100%;
  height: auto;
  display: block;
}

.info {
  padding-left: 0.5rem ;
}

.info p {
  margin: 0.4rem 0;
  font-size: 0.95rem;
}


/* Creator name */
.meme-card .info p:first-child {
  font-weight: bold;
  font-size: 1.1rem;
}

/* Dark Mode */
body.dark .meme-card {
  background-color: #111;
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.1);
}

/* Entrance animation */
@keyframes slideIn {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0px);
    opacity: 1;
  }
}


/* Responsive Text */

#All{
  display: none;
}

/* like dislike and comment */
.actions {

  display: flex;
  justify-content: center;
  align-items: center;
  /* flex-wrap: wrap; */
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  
}

.actions button {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s;
  color: white;
  background-color: #1e1e1e;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  
}

.actions button:hover ,nav button:hover{
  background-color: #3b3b3b;
  transform: translateY(-2px);
}

/* Dark mode support */
body.dark .actions button {
  background-color: #333;
  color: #fff;
}

body.dark .actions button:hover {
  background-color: #555;
}

/* Emoji button types */
.like-btn {
  background-color: #1e90ff;
}

.like-btn:hover {
  background-color: #3ea0ff;
}

.dislike-btn {
  background-color: #dc3545;
}

.dislike-btn:hover {
  background-color: #e74c5e;
}

.comment-btn,body.dark .comment-btn{
  background-color: #28a745;
  margin: auto;
  height: 30px;
  border-radius: 5px;
  border-style: none;
  padding: 0.3rem;
  margin-left: 5px;
}

.comment-btn:hover {
  background-color: #3bd161;
}

/* Responsive mobile support */


.comment-section {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f8f8f8;
  border-radius: 10px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
}
#submitbtn{

  border-radius: 5px;
  border: none;
  padding: 0.5rem;
}

#comments-panel {
  position: fixed;      /* FIXED to viewport */
  top: 120px;            /* 20px from top */
  right: 20px;          /* 20px from right */
  width: 400px;
  max-height: 300px;    /* height limit */
  overflow-y: auto;     /* scroll inside div */
  background-color: #222;
  color: #eee;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.7);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  border: 1px solid #444;
  scrollbar-width: thin;
  scrollbar-color: #888 #222;
  z-index: 9999;
}



/* Scrollbar styles for Webkit browsers (Chrome, Edge, Safari) */
#comments-panel::-webkit-scrollbar {
  width: 8px;
}

#comments-panel::-webkit-scrollbar-track {
  background: #222;
  border-radius: 8px;
}

#comments-panel::-webkit-scrollbar-thumb {
  background-color: #666;
  border-radius: 8px;
  border: 2px solid #222;
}

.fetched-comments .comment-block {
  margin-bottom: 0.8rem;
  padding: 0.5rem;
  background-color: #333;
  border-radius: 6px;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

.fetched-comments .comment-block strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: #ffdd57;
}

.no-comment, .error-comment {
  font-style: italic;
  color: #bbb;
  text-align: center;
}


#profile{
  position: fixed;
   left: 0%;
   width: 50%;
   height: 100%;
   display: none;
}
#profile>div{
  
  align-items: center;
   display: flex;
   flex-direction: column;
   width: 100%;
   gap: 10px;
   font-size: 1.2 rem;
   box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
   background-color: #f4f4f4;
}
#profile>button{
  position: absolute;
  right: 0%;
  width: 50px;
  height: 50px;
  border-style: none;
  background-color: rgba(236, 1, 1, 0.747);
  
}
#profile div>button{
  padding: 0.8rem;
  border: 1px solid;
  background-color: white;
  color: #111;
  cursor: pointer;
}

body.dark #profile>div{
  background-color: #111;
  
}

body.dark #profile div>button{
  background-color: white;
  color: #111;
  padding: 0.8rem;
  border: 1px solid;
   background-color: #111;
  color: white;
}
 #mainprofile{
    /* background-image: url("https://png.pngtree.com/png-vector/20190710/ourmid/pngtree-user-vector-avatar-png-image_1541962.jpg"); */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 50px;
    width: 100px;
    height: 100px;
    border: 1px solid;
  }

  #edit{
    
    width: 100%;
    /* flex-direction: column;
    align-items: center;
    justify-content: center; */
    text-align: center;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    display: none;
    gap:5px;
    padding-bottom: 10px;
  }
  
  #edit h2 {
    text-align: center;
    margin-bottom: 10px;
  }
  
 
  
  #edit input,
  #edit button:last-child {
    width: 80%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
  }
  
  #edit button:last-child,body.dark #edit button:last-child {
    background-color: #4CAF50;
    margin-top: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    margin: auto;
    border-style: none;

    
  }
  
  /* #edit button:hover {
    background-color: #45a049;
    
  } */
  #editclose{
    text-align: center;
    /* background-color: #45a049; */
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    
  }
  body.dark #edit{
  background-color: white;
  color: #111;
  border: 1px solid;
   background-color: #111;
  color: white;
}
#edit button:nth-child(1),body.dark #edit button:nth-child(1){
      background-color:  rgb(250, 37, 37);
      color: #111;
      border-style: none;
      border-radius: 5px;

}



@media (width < 600px) {
  
  #image{
    display: flex;
    align-items: center;
    gap:2px;
    color: #111;
    margin-left: 10%;
    font-size: 1.5rem;
    
}
  header{
    display: flex;
    
  }
  header #image,#namefe{
    font-size: 0.8rem;
    width: 30%;
 
  }
  nav{
    display: flex;
    align-items: center;
    justify-content: center;
  }

  nav button {
    font-size: 0.5rem;
    padding: 0.3rem;
    
  }
  #profile>div>button,body.dark #profile>div>button{
    padding: 0.3rem;
    font-size: 0.5rem;
    
  }

  .info p {
    font-size: 0.9rem;
  }
 #like,#dislike,#comment{
  font-size: 0.5rem;
  padding: 0.2rem 0.5rem;
  margin: 0%;
 }
    #profile{
      position: fixed;
      width: 60%;
         
    }
    #profile button:nth-child(1){
      font-size: 0.5rem;
      width: 30px;
      height: 30px;
    }
    #profile>div{
      width: 100%;
      font-size:0.4rem;
    }
    
     #edit{
        width: 100%; 
     }
     #edit *{
      font-size: 0.5rem;
     }
     #edit input{
      height: 20px;
      font-size: 0.5rem;
      padding: 0%;
     }
     #edit button:nth-child(1){
      background-color:  rgb(250, 37, 37);
      color: #111;
      width: 30px;
      border-style: none;
     }
     #edit button:nth-last-child(1),body.dark  #edit button:nth-last-child(1){
      width: 30px;
      font-size: 0.5rem;
      margin-top: 10px;
     }

     #mainprofile{
    /* background-image: url("https://png.pngtree.com/png-vector/20190710/ourmid/pngtree-user-vector-avatar-png-image_1541962.jpg"); */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 50px;
    width: 50px;
    height: 50px;
    border: 1px solid;
  }
      

  
}