html {
    min-height: 100%;
    cursor: url("../images/conch-cursor.png") 4 2, auto;
}

body
{
    margin: 0;
    padding: 0;
    background-color: #707070;
    background-image: url("../images/background.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    cursor: url("../images/conch-cursor.png") 4 2, auto;
}

#title 
{
    font-size: 60px;
    width: 100%;          
    margin: 20px 0;      
    text-align: center; 
    padding-left: 0;      
    font-family: 'Pacifico', cursive;
    text-shadow: 2px 2px 8px rgba(255, 255, 255, 1); 
    color: #3B270C;
    display: block;
}


#loginDiv {
    position: relative;           
    margin: 20px auto;
    width: 350px;                  
    padding: 30px;                  
    background-color: rgba(217, 226, 240, 0.75); 
    backdrop-filter: blur(8px);     
    border-radius: 20px;           
    box-shadow: 0 4px 20px rgba(0,0,0,0.3); 
    z-index: 1001; 
    
}

.input-error {
    border: 2px solid red;
    background-color: #ffe5e5; 
}

.input-error + .required {
    color: red;
}


#logoutButton {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 200px;
    height: 50px;
    font-size: 24px;
    border-radius: 25px;
    background-color: #dbad8a;
    color: #3B270C;
    border: none;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-family: 'Ubuntu', sans-serif;
    transition: transform 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease, background-color 0.2s ease;
}

#logoutButton:hover,
#logoutButton:focus-visible {
    background-color: #c18b6e;
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: 2px solid #294A7E;
}

#accessUIDiv
{
    font-size: 30px;
    width: 70%;
    margin-left: 15%;
    padding: 25px;
    background-color: rgba(217, 226, 240, 0.75);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

#searchWrapper {
    display: flex;             
    flex-direction: row; 
    align-items: stretch; 
    width: 100%;  
    max-width: 100%;
    gap: 10px; 
}

#searchText {
    flex: 1; 
    height: 50px;
    font-size: 30px;
    box-sizing: border-box;
    padding-left: 20px;
    margin: 0; 
    padding: 0 10px;
}

#searchColorButton {
    display: flex; 
    flex-shrink: 0; 
    width: 60px;                
    height: 50px; 
    margin: 0; 
    justify-content: center; 
    align-items: center; 
    border-radius: 15px;
    background-color: #D9E2F0;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#addContactButton {
    grid-column: 3;
    justify-self: end; 
    background-color: #D9E2F0;
    width: 60px;
    height: 50px;
    padding: 0;
    font-size: 22px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-row {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr; 
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

#clientListTitle {
    grid-column: 2; 
    margin: 0;
    text-align: center;
    font-size: 40px;
    white-space: nowrap;
    font-family: 'Pacifico', cursive;
    text-shadow: 2px 2px 8px rgba(255, 255, 255, 1);
    color: #3B270C;
}

.buttons
{
    font-size: 30px;
    border-radius: 25px;
    width: 50%;
    margin-left: 25%;
    font-family: 'Ubuntu', sans-serif;
    background-color: #D9E2F0;
    color: #3B270C;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease, background-color 0.2s ease;
}

.buttons:hover,
.buttons:focus-visible {
    background-color: #c3cedf;
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: 2px solid #294A7E;
}

/* --- Inline Row Buttons (Edit, Delete, Save, Cancel) --- */

.editButton {
    font-size: 16px;
    font-family: 'Ubuntu', sans-serif;
    border: none;
    border-radius: 25px;
    padding: 6px 14px;
    background-color: #D9E2F0;
    color: #3B270C;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease, background-color 0.2s ease;
}

.editButton:hover,
.editButton:focus-visible {
    background-color: #c3cedf;
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: 2px solid #294A7E;
}

.deleteButton {
    font-size: 16px;
    font-family: 'Ubuntu', sans-serif;
    border: none;
    border-radius: 25px;
    padding: 6px 14px;
    background-color: #dbad8a;
    color: #3B270C;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease, background-color 0.2s ease;
}

.deleteButton:hover,
.deleteButton:focus-visible {
    background-color: #c18b6e;
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: 2px solid #294A7E;
}

.saveButton {
    font-size: 16px;
    font-family: 'Ubuntu', sans-serif;
    border: none;
    border-radius: 25px;
    padding: 6px 14px;
    background-color: #D9E2F0;
    color: #3B270C;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease, background-color 0.2s ease;
}

.saveButton:hover,
.saveButton:focus-visible {
    background-color: #c3cedf;
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: 2px solid #294A7E;
}

.cancelButton {
    font-size: 16px;
    font-family: 'Ubuntu', sans-serif;
    border: none;
    border-radius: 25px;
    padding: 6px 14px;
    background-color: #dbad8a;
    color: #3B270C;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease, background-color 0.2s ease;
}

.cancelButton:hover,
.cancelButton:focus-visible {
    background-color: #c18b6e;
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: 2px solid #294A7E;
}

#loginName
{
	font-size: 30px;
}
#loginPassword
{
	font-size: 30px;
}

#colorText
{
	font-size: 30px;
}


.password-toggle {
    position: absolute;
    cursor: pointer;
    user-select: none;
    line-height: 0;
}

.toggle-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    transition: transform 0.15s ease;
}

.password-toggle:hover .toggle-icon,
.password-toggle:focus-visible .toggle-icon {
    transform: scale(1.1);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    outline: none;
    filter: drop-shadow(0 0 4px rgba(41, 74, 126, 0.8));
}


#loginTogglePassword {
    top: 5px;   
    left: 89%;   
}

#signupTogglePassword {
    top: 7px;   
    left: 89%;    
}

input[type="text"],input[type="password"]{
    border-radius: 25px;
    text-align: center;
    width: 90%;
    margin-left: 7%;
    margin-bottom: 10%; 
    font-family: 'Ubuntu', sans-serif;
}

#inner-title{
    display: inline-block;
    font-size: 25px;
    width: 90%;
    text-align: center;
    margin-left: 5%;
    margin-bottom: 7%;
    margin-top: 2%; 
    font-family: 'Ubuntu', sans-serif;
    color: #3B270C;
    font-weight: bold;
}

#loginResult{
    display: inline-block;
    font-size: 14px;
    width: 90%;
    text-align: center;
    margin-right: 20px;
    margin-bottom: 20px;;
    font-family: 'Ubuntu', sans-serif;
    color: #80060ae9;
}

#userName{
    display: inline-block;
    width: 80%;
    margin-left: 10%;
    text-align: center;
}


select{
    width: 30%;
    margin-left: 35%;
    margin-top: 2%;
    font-size: 0.75em;
    font-family: 'Ubuntu', sans-serif;
}

#colorSearchResult{
    display: none;
}

#colorAddResult{
    display: inline-block;
    font-size: 0.8em;
    width: 90%;
    text-align: center;
    margin-left: 5%;
    margin-top: 2%;
    margin-bottom: 1%;
    font-family: 'Ubuntu', sans-serif;
    color: #80060ae9;
}


#loginToggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 200px;
    height: 50px;
    font-size: 24px;
    border-radius: 25px;
    background-color: #dbad8a;
    color: #fff;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease, background-color 0.2s ease;
}

#loginToggle:hover,
#loginToggle:focus-visible {
    background-color: #c18b6e;
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: 2px solid #294A7E;
}



#loginSignupTabs {
    display: flex;
    justify-content: space-around; 
    margin-bottom: 20px;           
}


.tabButton {
    background: transparent;
    border: none;
    font-size: 20px;
    font-family: 'Ubuntu', sans-serif;
    cursor: pointer;
    padding: 10px 20px;
    color: #3B270C;
    transition: transform 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease;
}

.tabButton:hover,
.tabButton:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: 2px solid #294A7E;
    color: #3B270C;
    transition: 0.3s;
}

.tabButton.active {
    border-bottom: 3px solid #3B270C; 
    border-bottom: 3px solid #805326; 
    font-weight: bold;
}

#signupForm input {
    width: 85%;              
    padding: 10px;          
    font-size: 15px;         
    margin: 1px 7.5%;     
    border-radius: 25px;    
    text-align: center;     
    display: block;        
    font-family: 'Ubuntu', sans-serif;
}

.required {
    display: inline-block;   
    color: black;
    font-weight: bold;
    font-size: 20px;         
    margin-left: 6px;
    position: relative;
    top: -30px;       
}

.rules {
    font-weight: bold;
    display: none;           
    font-size: 16px;
    color: #3B270C;           
    font-size: 18px;
    margin-top: 15px;        
}

.rules ul {
  list-style: none;  
  padding-left: 0;    
  margin: 0;          
}

.rules li {
  margin-bottom: 6px; 
}

#registerResult{
    font-size: 14px;
    text-align: center;
    color: #80060ae9;
    margin-bottom: 20px;
    font-family: 'Ubuntu', sans-serif;
}

button {
    transition: transform 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease;
}

button:hover,
button:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: 2px solid #294A7E;
}

#registerResult ul {
    list-style-type: none;
    padding-left: 20px; 
}

#registerResult ul li::before {
    content: "🌊 ";  
}

/* override browser default cursor for interactive elements */
button,
a,
select,
option,
input[type="button"],
input[type="submit"],
input[type="reset"],
[role="button"],
.buttons,
.tabButton,
* {
  cursor: url("../images/conch-cursor.png") 4 2, auto;
}

#contactsTable {
    margin: 10px auto;
    border-collapse: collapse;
    width: 90%;
    text-align: center;
    font-family: 'Ubuntu', sans-serif;
    font-size: 20px;
}

#contactsTable th,
#contactsTable td {
    padding: 10px 15px;
}

#contactsTable th {
    font-weight: bold;
    border-bottom: 2px solid #3B270C;
}

#contactsTable input[type="text"]:focus {
    box-shadow: 0 0 6px rgba(41, 74, 126, 0.5);
    outline: none;
}

/* leave I-beam inline cursor */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
textarea,
[contenteditable="true"] {
  cursor: text !important;
}

button, a, [role="button"], input[type="submit"], input[type="button"] {
  cursor: url("../images/conch-cursor.png") 4 2, pointer !important;
}

/* Splash screen overlay – visible on page load */
#splashOverlay {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(59, 39, 12, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

#splashOverlay.active {
  display: flex;
}

#splashSpinner {
  position: relative;
  width: 200px;
  height: 200px;
}

#splashSpinner::before {
  content: "";
  position: absolute;
  top: -8px;
  left: -8px;
  width: 216px;
  height: 216px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  animation: splash-chase 0.8s linear infinite;
}

#splashLogo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  object-fit: contain;
}

@keyframes splash-chase {
  to { transform: rotate(360deg); }
}

/* Toast notification */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #3B270C;
  padding: 20px 40px;
  border-radius: 12px;
  font-size: 22px;
  font-family: 'Ubuntu', sans-serif;
  font-weight: bold;
  outline: 3px solid #294A7E;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.toast-success {
  background-color: #d4edda;
}

.toast-error {
  background-color: #f8d7da;
}

.toast.show {
  opacity: 1;
}

.toast.fade-out {
  opacity: 0;
}

/* Focus styles for elements without a :hover equivalent */
input[type="text"]:focus-visible,
input[type="password"]:focus-visible {
    outline: 2px solid #294A7E;
    box-shadow: 0 0 6px rgba(41, 74, 126, 0.5);
}


:root {
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Keyframes --- */

@keyframes row-highlight {
    0%   { background-color: rgba(41, 74, 126, 0.18); }
    100% { background-color: transparent; }
}

@keyframes fade-in-up {
    0%   { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes modal-enter {
    0%   { opacity: 0; transform: scale(0.97); }
    100% { opacity: 1; transform: scale(1); }
}

/* --- Utility Classes --- */

.row-highlight {
    animation: row-highlight 800ms var(--ease-out) forwards;
}

.cell-highlight {
    animation: row-highlight 800ms var(--ease-out) forwards;
}

.fade-in-up {
    animation: fade-in-up 180ms var(--ease-out) both;
}

.action-fade-in {
    animation: fade-in-up 150ms var(--ease-out) both;
}

/* --- Login Modal Entrance --- */

#loginDiv {
    animation: modal-enter 220ms var(--ease-out) both;
}

/* --- Signup Success Button State --- */

.btn-success-state {
    background-color: #6fbf73 !important;
    color: #fff !important;
    transition: background-color 200ms var(--ease-out);
}

/* --- Search Results Fade --- */

#contactSearchResult.fading {
    opacity: 0.6;
    transition: opacity 80ms var(--ease-out);
}

#contactSearchResult {
    transition: opacity 80ms var(--ease-out);
}

/* --- Edit Mode Morph: Crossfade Text → Input --- */

#contactsTable td {
    position: relative;
}

.cell-morph-text {
    display: inline-block;
    transition: opacity 180ms var(--ease-out);
}

.cell-morph-text.fading {
    opacity: 0;
}

#contactsTable td input[type="text"] {
    border-color: transparent;
    background-color: transparent;
    transition: border-color 180ms var(--ease-out), background-color 180ms var(--ease-out), opacity 180ms var(--ease-out);
    width: 90%;
    text-align: center;
    font-family: 'Ubuntu', sans-serif;
    font-size: inherit;
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px solid transparent;
    margin-left: 0;
    margin-bottom: 0;
}

#contactsTable td input[type="text"].morph-visible {
    border-color: #294A7E;
    background-color: rgba(255, 255, 255, 0.85);
}

/* --- Delete Confirmation Modal --- */

.delete-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(59, 39, 12, 0.7);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.delete-overlay.active {
  display: flex;
}

.delete-modal {
  background-color: rgba(217, 226, 240, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: 30px 40px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  font-family: 'Ubuntu', sans-serif;
  color: #3B270C;
  animation: modal-enter 220ms var(--ease-out) both;
}

.delete-modal p {
  margin: 0 0 10px;
  font-size: 20px;
}

.delete-warning {
  font-size: 15px !important;
  color: #805326;
  margin-bottom: 24px !important;
}

.delete-modal-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.delete-modal-btn {
  font-size: 18px;
  font-family: 'Ubuntu', sans-serif;
  border: none;
  border-radius: 25px;
  padding: 10px 28px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease, background-color 0.2s ease;
}

.delete-modal-btn:hover,
.delete-modal-btn:focus-visible {
  transform: scale(1.08);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  outline: 2px solid #294A7E;
}

.delete-cancel-btn {
  background-color: #dbad8a;
  color: #3B270C;
}

.delete-cancel-btn:hover,
.delete-cancel-btn:focus-visible {
  background-color: #c18b6e;
}

.delete-confirm-btn {
  background-color: #c0392b;
  color: #fff;
}

.delete-confirm-btn:hover,
.delete-confirm-btn:focus-visible {
  background-color: #a93226;
}

.key-hint {
  font-size: 11px;
  opacity: 0.6;
  margin-left: 4px;
  vertical-align: middle;
}

/* --- Reduced Motion --- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}