/* styles.css */

:root {
    --primary-bg: #1a1a1a;
    --secondary-bg: #2e2e2e;
    --text-color: #dcdcdc;
    --input-bg: #3a3a3a;
    --button-bg: #4a4a4a;
    --button-hover: #606060;
    --list-bg: rgba(43, 43, 43, 0.9);
    --blurred-bg: rgba(43, 43, 43, 0.7);
    --placeholder-color: #8c8c8c;
  }
  
  body {
    font-family: 'Cherry Cream Soda', cursive;
    background-color: var(--primary-bg);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
  }
  
  .container {
    background: var(--secondary-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    padding: 20px;
    max-width: 500px;
    width: 100%;
    text-align: center;
  }
  
  .title {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 10px;
  }
  
  .subtitle {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 20px;
  }
  
  textarea,
  input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--input-bg);
    border-radius: 8px;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-color);
    font-family: inherit;
  }
  
  textarea::placeholder {
    color: var(--placeholder-color);
  }
  
  textarea:focus,
  input:focus {
    outline: none;
    border-color: var(--button-hover);
  }
  
  .button {
    background: var(--button-bg);
    color: var(--text-color);
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
  }
  
  .button:hover {
    background: var(--button-hover);
  }
  
  .capsule-title {
    margin-top: 20px;
    font-size: 20px;
    color: var(--text-color);
  }
  
  .capsule-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .capsule-list li {
    position: relative;
    background: var(--list-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s ease;
  }
  
  .capsule-list li:hover {
    transform: scale(1.03);
  }
  
  .capsule-list li .blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(12px);
    background: var(--blurred-bg);
    z-index: 1;
  }
  
  .capsule-list li .countdown {
    position: relative;
    z-index: 2;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
  }
  
  .capsule-list li .message {
    display: none;
    font-size: 16px;
    color: var(--text-color);
    word-break: break-word;
    text-align: center;
  }
  


/* Add poof effect */
.poof {
    opacity: 0;
    transform: scale(0);
    transition: all 0.5s ease;
  }
  
  /* Styling for delete icon */
  .delete-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
  }
  
  /* Font Awesome icon styling */
  .delete-icon i {
    font-size: 18px;
    color: #fff;
  }
  
  .delete-icon:hover {
    color: red;
  }
  
  /* Styling for capsule container */
  #capsuleList li {
    position: relative;
    background-color: #333;
    color: #fff;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3);
  }
  
  #capsuleList li .blur {
    background: rgba(0, 0, 0, 0.6);
    filter: blur(8px);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
  }
  
  #capsuleList li .countdown {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    font-size: 16px;
    z-index: 2;
  }
  
  #capsuleList li .message {
    display: none;
    color: white;
    z-index: 2;
  }
  
  #capsuleList li .timestamp {
    position: absolute;
    bottom: 5px;
    right: 10px;
    color: #ddd;
    font-size: 12px;
    z-index: 2;
  }
  
  /* Example of how the countdown works */
  #capsuleList li .countdown {
    display: block;
    font-size: 18px;
    text-align: center;
  }
  
  /* Hovering and clicking */
  #capsuleList li:hover {
    background-color: #444;
  }
  
  
  /* Error message styling */
#errorMessage {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    color: red;
    display: none;
    opacity: 0;
    z-index: 2;
  }
  
  #errorMessage.visible {
    display: block;
    opacity: 1;
    animation: fadeOut 3s ease-in-out;
  }
  
  @keyframes shake {
    0% { transform: translateX(-10px); }
    25% { transform: translateX(10px); }
    50% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
    100% { transform: translateX(0); }
  }
  
  #errorMessage.shake {
    animation: shake 0.5s ease-in-out;
  }
  
  /* Add a fade-out effect */
  @keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
  }
  
  /* Style for the message box container */
#messageContainer {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
  }
  
  /* Style for the character count */
  .char-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 14px;
    color: gray;
  }
  
  /* Optional: Style when nearing max character count */
  #message:valid ~ .char-count {
    color: green;
  }
  
  #message:invalid ~ .char-count {
    color: red;
  }
  