
/* body {
    background-color: #f0f2f5;
    font-family: Arial, sans-serif;
} */
.container {
    margin-top: 50px;
    margin-bottom: 40px;
}
.cipher-section {
    display: none;
}
.result-box {
    min-height: 100px;
    background-color: #ffffff;
    border: 1px solid #ced4da;
    padding: 10px;
}
.card {
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    background-color: #f8f8f8; 
    color: #000; /* makes text inside readable */
    border: none;
}
.hero-section {
position: relative;
padding: 100px 0;
}
.hero-image-container {
    width: 100%;
    height: 100%;
}
.hero-image {
    width: 100%;
    height: 100%; /* Ensure it fills the container */
    object-fit: cover; /* Ensure the image covers the area without stretching */
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1; /* Ensure the image is behind the text */
}

.hero-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7); /* Black with 70% opacity */
z-index: 1; /* Place the overlay above the image */
}
.hero-content {
position: relative;
top: 30px; /* Adjust top positioning for the text */
left: 30px; /* Adjust left positioning for the text */
z-index: 2; /* Ensure text is above the overlay */
}
.hero-content h1 {
    font-size: 3em;
    font-weight: bold;
}

.hero-content p {
    font-size: 1.2em;
}


.custom-disclaimer {
    font-weight: 500;
    font-size: 1rem;
    background-color: #fff3cd;
    border-left: 5px solid #ffc107;
    padding: 1rem;
    margin: 2rem auto;
    max-width: 900px;
    border-radius: 6px;
}

/* tooltips for ciphers' parameter '?' */
.tooltip-icon {
  cursor: pointer;
  margin-left: 6px;
  color: #007bff;
  font-weight: normal;
  user-select: none;
  position: relative;
}

.tooltip-icon:hover::after,
.tooltip-icon:focus::after {
  content: attr(aria-label);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translate(8px, -50%);
  background-color: rgba(51, 51, 51, 0.85);  
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 1000;
  font-size: 0.875rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.tooltip-icon::after {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.tooltip-icon:hover::after,
.tooltip-icon:focus::after {
  opacity: 1;
}

/* Cipher Table */

.cipher-table-wrapper {
    margin-top: 20px;
    text-align: center;
    /* overflow-x: auto; */
}

.cipher-table {
    display: grid;
    grid-template-columns: repeat(26, 1fr);
    gap: 5px;
    margin-bottom: 10px;
    overflow-x: auto;
    
}
.cell {
  background-color: #ffffff;
  color: #000;
  border: 1px solid #ccc;
  padding: 10px;
  font-weight: bold;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease; /* ✨ transition added */
}

.cell.hovered {
  background-color: #cddc39; /* Highlighted greenish */
  cursor: pointer;
  color: #000;
}


.cell::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -25px;
    background: #222;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.cell:hover::after {
    opacity: 1;
}

.row-label {
    font-weight: bold;
    margin-bottom: 6px;
}

.cell.highlighted {
  background-color: #cddc39; /* your highlight color */
  cursor: pointer;
  color: #000;
}


  .vigenere-container {
    position: relative;
    background: #fff;
    padding: 20px 20px 20px 60px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    max-width: 100%;
  }

  .vigenere-container {
    overflow: visible;
  }
  

  .visual-section .caption {
    font-size: 0.95rem;
    color: #5f6368;
    margin-bottom: 20px;
  }

  .axis-labels {
    position: relative;
    padding-left: 60px;
    margin-top: 40px;
    
  }

  /* Top label */
.axis-label-top {
  position: absolute;
  top: -32px;
  left: 37%;
  transform: translateX(-50%);
  font-weight: bold;
  font-size: 1rem;
  color: #444;
}

/* Side label */
.axis-label-left {
  position: absolute;
  top: 450px;
  left: -37px;
  transform: rotate(-90deg) translateY(50%);
  transform-origin: top left;
  font-weight: bold;
  font-size: 1rem;
  color: #444;
  white-space: nowrap;
}


  /* vigenere tabe style */
  
  /*hide table when not select vigenere cipher*/
  #vigenereTable {
  display: none;
  }

  .vigenere-table-container {
    border-collapse: collapse;
    width: 100%;
  }

  .vigenere-table-container {
    background-color: #e3f2fd;
    padding: 24px;
    border-radius: 12px;
    margin-top: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  }

  .vigenere-table-container .caption {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 16px;
  }

  /* Table title and explanation */
  .vigenere-table-container h5 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 10px;
  }

  /* Instruction box */
  .instruction-box {
    background-color: #fff;
    border-left: 5px solid #42a5f5;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: #333;
    border-radius: 6px;
  }

  .vigenere-table-container td {
    cursor: pointer;
  }

  
  .vigenere-table-container th,
    .vigenere-table-container td {
      min-width: 32px;
      height: 32px;
      padding: 4px;
      font-size: 14px;
      text-align: center;
      border: 1px solid #ccc;
      cursor: pointer;
    }

    .vigenere-table-container thead th {
      background-color: #a4cbe7;
      position: sticky;
      top: 0;
      z-index: 2;
    }

    .vigenere-table-container th:first-child {
      background-color: #bbdefb;
      position: sticky;
      left: 0;
      z-index: 3;
    }

    .highlight-row {
      background-color: #fff9c4 !important;
    }

    .highlight-col {
      background-color: #c8e6c9 !important;
    }

    .locked {
      background-color: #90caf9 !important;
      color: rgb(94, 15, 15);
    }

  .tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white; 
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 10; /* ensure it's above sticky headers */

  }

  .tooltip:hover::after {
    opacity: 1;
  }

  .locked {
    background-color: #81c784 !important;
    /* color: white; */
  }
  
  /* Vigenère Cipher Works */
  /* Container around the whole visual table */
  .visual-section {
    background-color: #e3f2fd;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  }

  /* Title and description */
  .visual-section h5 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 10px;
  }

  .visual-section .caption {
    font-size: 0.95rem;
    color: #5f6368;
    margin-bottom: 20px;
  }

  .visual-section .cell.highlighted{
  background-color: #a7d4e4;  /* bright yellow highlight */
  transition: background-color 0.3s ease;
  color: #000;
  cursor: pointer;
  }

  /* Label before each row (Text / Keyword / Encrypted) */
  .row-label {
    font-weight: 500;
    color: #424242;
    margin: 10px 0 6px;
  }

  /* Wrapper for rows of boxes */
  .cipher-table-wrapper {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
  }

  /* Each row of cells (Text / Keyword / Result) */
  .cipher-table {
    display: grid;
    grid-auto-flow: column;
    gap: 6px;
    justify-content: start;
  }

  /* Individual letter cell */
  .cipher-table .cell {
    background-color: #1e1e2f;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    padding: 10px 14px;
    min-width: 34px;
    text-align: center;
    font-weight: 600;
    font-family: monospace;
    font-size: 1rem;
    color: #00ccff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: background-color 0.2s ease;
  }

/* usage notes */
.usage-notes {
  background-color: #cee8fd;
  border-left: 5px solid #42a5f5;
  padding: 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #333;
}
.usage-notes h6 {
  margin-bottom: 10px;
  color: #0d0d0d;
}
.usage-notes ul {
  padding-left: 1.2rem;
}

/* caesar table visualizer */
.caesar-table {
  background-color: #1e1e2f;
  padding: 16px;
  border-radius: 8px;
}


.row-label {
  font-weight: bold;
  color: white;
  margin: 12px 0 6px;
}

.alphabet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.letter-box {
  border: 1px solid #555;
  padding: 10px 14px;
  min-width: 32px;
  text-align: center;
  color: #00ccff;
  background-color: #2e2e3e;
  font-weight: bold;
  font-family: monospace;
  transition: background-color 0.3s ease;
}

.letter-box.match {
  background-color: #666;
}

.caesar-container {
  background-color: #e3f2fd; /* Light blue or adjust for dark mode */
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  margin-top: 24px;
}

 .caesar-container h5 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 10px;
  }


/* new railfence */



.rail-fence-table {
  margin-top: 15px;
}

/* Single scroll container wrapping all rails */
.rail-fence-scrollable {
  overflow-x: auto;
  white-space: nowrap;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
}

/* Each rail row */
.rail-row {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  margin-bottom: 10px;
}

.rail-lebel {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  margin-bottom: 10px;
  align-items: center;
  font-weight:bolder;
  font-family: monospace;
}

.rail-row {
  display: flex;
  align-items: center;
  font-family: monospace;
}

/* .rail-label {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  width: 60px;
  margin-bottom: 10px;
  font-weight: bold;
  text-align: right;
  color: #333;
} */


/* Character cells */
.rail-cell {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  margin-right: 6px;
  border: 2px solid #0a324d;
  border-radius: 6px;
  font-weight: 700;
  font-size: 18px;
  user-select: none;
  background-color: #f0f6ff;
  color: #154c79;
  box-sizing: border-box;
  white-space: nowrap;
}

.rail-cell.empty {
  border: 2px solid transparent;
  background-color: transparent;
  margin-right: 6px;
}

.rail-cell.active {
  background-color: #7bb0f8;
  color: white;
  border-color: #4c85e1;
  box-shadow: 0 0 6px rgba(122, 147, 201, 0.8);
}

.rail-cell.space-cell {
  background-color: #e0e7ff;
  border: 2px dashed #7a89c9;
  color: transparent;
}

.rail-cell.pattern-cell {
  background-color: #a3c8f5;
  border-radius: 6px;
  font-size: 16px;
  color: #0a324d;
}


/* Playfair Cipher Visualizer */

.playfair-matrix {
  display: inline-block;
  margin-bottom: 20px;
  border: 2px solid #4c85e1;
}
.matrix-row {
  display: flex;
}
.matrix-cell {
  width: 40px;
  height: 40px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #154c79;
  background-color: #f0f6ff;
  font-weight: bold;
  font-size: 16px;
  margin: 1px;
}

.step-block {
  border: 1px solid #ccc;
  background-color: #fff;
  padding: 10px;
  margin-bottom: 10px;
  border-left: 5px solid #4c85e1;
}



/* .highlighted {
  background-color: #ffff99; /* light yellow 
  border-color: #ffcc00 !important;
} */

.matrix-cell.selected {
  background-color: #aaf0d1;
  border: 2px solid #33cc99;
  font-weight: bold;
}

/* tooltips */

.cell[data-tooltip] {
  position: relative;
  /* cursor: help; */
}

.cell[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  white-space: nowrap;
  background: rgba(57, 57, 56, 0.75);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  top: 0;
  left: 100%;
  transform: translateX(-50%);
  /* margin-top: 1px; */
  font-size: 12px;
  z-index: 10;
  
}

/* 
.cell[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
} */

.modal-header.bg-warning {
  background-color: #ffc107 !important;
}

/* Adjustments for Mobile */
@media (max-width: 767px) {
    .hero-section h1 {
        font-size: 2.5em;
    }
    .hero-section p {
        font-size: 1em;
    }
}

@media (max-width: 768px) {
    #logo img {
        max-width: 120px; /* Smaller logo on mobile */
    }
}
