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

:root {
  --main-text-font: 'Poppins', sans-serif;
  --title-font: 'MedievalSharp', cursive;
  --base-font-size: 16px; /* Default base font size */
}

body {
    scrollbar-3dlight-color:#FAFBF6;
    scrollbar-arrow-color:#BD6549;
    scrollbar-base-color:#FAFBF6;
    scrollbar-face-color:#FAFBF6;
    scrollbar-highlight-color:#FAFBF6;
    scrollbar-shadow-color:#FAFBF6;
    scrollbar-track-color:#FAFBF6;
    background-image:url('https://omniakashica.com/wp-content/uploads/2024/11/Designer-40.jpeg');
    background-size:cover;
    background-position:center;
    background-repeat:no-repeat;
    color:#fff;
    min-height: 100vh; /* Ensure body takes full viewport height */
    display: flex; /* Use flexbox for centering content */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    padding: 20px; /* Add some padding around the content */
    box-sizing: border-box; /* Include padding in element's total width and height */
    font-family: var(--main-text-font); /* Applied Google Font using variable */
    font-size: var(--base-font-size); /* Applied base font size using variable */
}

.letragrande {
    font-family: var(--title-font); /* Applied medieval font using variable */
    font-size: calc(var(--base-font-size) * 1.5); /* Scaled relative to base */
    font-weight:bold;
}

.consultaCompleta {
    font-size: calc(var(--base-font-size) * 1.125); /* Scaled relative to base (18px) */
}

.contato {
    font-size: var(--base-font-size); /* Scaled relative to base (16px) */
}

table {
    background:rgba(0,0,0,0.7);
    padding:20px;
    border-radius:10px;
    width: 95%; /* Make table take 95% width of its container */
    max-width: 700px; /* Set a reasonable max-width for desktop for better readability */
    margin: 20px auto; /* Center the table and add vertical margin */
}

input[type="button"], input[type="reset"], .email-button {
    background: linear-gradient(45deg, #4CAF50, #DAA520);
    border: none;
    padding: 10px 20px;
    color: white;
    font-weight: 600; /* Use Poppins semibold weight */
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: perspective(1px) translateZ(0);
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    text-decoration: none;
    display: inline-block;
    width: auto; /* Allow buttons to size based on content */
    min-width: 120px; /* Give a minimum width for better touch targets */
    box-sizing: border-box;
    font-size: var(--base-font-size); /* Applied base font size using variable */
}

input[type="button"]:hover, input[type="reset"]:hover, .email-button:hover {
    background: linear-gradient(45deg, #45a049, #B8860B);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

input[type="button"]:active, input[type="reset"]:active, .email-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

input[type="text"] {
    padding: 8px;
    border-radius: 5px;
    border: 2px solid #DAA520;
    background: rgba(255,255,255,0.9);
    transition: all 0.3s ease;
    width: 100%; /* Make input take full width */
    max-width: 100%; /* Override the size="100" attribute */
    box-sizing: border-box;
    font-family: var(--main-text-font); /* Apply font to input using variable */
    font-size: calc(var(--base-font-size) * 1); /* Scaled relative to base */
}

input[type="text"]:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 10px rgba(218,165,32,0.5);
}

.button-group {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.result-box {
    background: rgba(255,255,255,0.15);
    border: 2px solid #DAA520;
    border-radius: 5px;
    padding: 15px;
    margin: 20px auto;
    text-align: center;
    color: white;
    font-size: calc(var(--base-font-size) * 1.75); /* Scaled for main result number on desktop */
    font-weight: 600; /* Use Poppins semibold weight */
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    max-width: 90%;
    line-height: 1.4;
    box-sizing: border-box;
    transition: opacity 0.5s ease-in-out; /* Smooth fade-in effect */
}

.result-box #arcanoDescription { /* Specific style for the description text */
    font-size: calc(var(--base-font-size) * 1.25); /* Scaled description text for desktop */
    font-weight: 400; /* Normal Poppins weight */
    backdrop-filter: blur(5px); /* Ensure backdrop filter is present if removed */
    white-space: pre-wrap; /* Allows \n\n to render as paragraph breaks */
    text-align: justify; /* Justify text for a more formal look */
    padding: 10px 0;
}

.result-box img {
    display: block;
    margin: 15px auto 0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    max-width: 100%; /* Ensure image doesn't overflow its container */
    height: auto; /* Maintain aspect ratio */
}

.result-box img:hover {
    transform: scale(1.05);
}

/* Error message styles */
.error-message {
    color: #ff6b6b; /* Reddish color for errors */
    font-size: calc(var(--base-font-size) * 0.875); /* Scaled */
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
}

/* Loading spinner styles */
.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #DAA520; /* Spinner color */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    display: none; /* Hidden by default */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Floating whatsapp button styles (no changes needed, it's the base for the pattern) */
.floating-whatsapp-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(45deg, #25D366, #128C7E);
    color: white;
    width: 50px; /* Decreased size */
    height: 50px; /* Decreased size */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4); /* Adjusted shadow */
    z-index: 1000;
    text-decoration: none; /* Remove underline for anchor tag */
    transition: all 0.3s ease;
}

.floating-whatsapp-button:hover {
    background: linear-gradient(45deg, #128C7E, #075E54);
    transform: translateY(-3px) scale(1.05); /* Enhanced hover effect */
    box-shadow: 0 8px 20px rgba(0,0,0,0.5); /* Enhanced hover shadow */
}

.floating-whatsapp-button:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.floating-whatsapp-button img {
    width: 30px; /* Decreased icon size */
    height: 30px;
    display: block; /* Ensure no extra space around image */
}

/* Floating home button styles */
.floating-home-button {
    position: fixed;
    bottom: 140px; /* stacked above settings and whatsapp */
    right: 20px;
    background: linear-gradient(45deg, #444, #222);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    z-index:1000;
    text-decoration:none;
    transition: all 0.2s ease;
}
.floating-home-button:hover { transform: translateY(-3px) scale(1.05); box-shadow:0 8px 20px rgba(0,0,0,0.45); }
/* make svg icon scale nicely */
.floating-home-button svg { width:28px; height:28px; }

/* Floating settings button styles - now based on WhatsApp button's gradient pattern */
.floating-settings-button {
    position: fixed;
    bottom: 80px; /* Adjusted position relative to smaller WhatsApp button */
    right: 20px;
    /* Updated gradient to follow the pattern of the WhatsApp button,
       using the app's golden accent colors for distinction. */
    background: linear-gradient(45deg, #DAA520, #A0522D); /* Golden/Brown gradient */
    color: white;
    width: 50px; /* Decreased size */
    height: 50px; /* Decreased size */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4); /* Adjusted shadow */
    z-index: 1000;
    text-decoration: none;
    transition: all 0.3s ease;
}

.floating-settings-button:hover {
    /* Darker golden/brown gradient for hover effect */
    background: linear-gradient(45deg, #A0522D, #8B4513);
    transform: translateY(-3px) scale(1.05); /* Enhanced hover effect (consistent with WhatsApp) */
    box-shadow: 0 8px 20px rgba(0,0,0,0.5); /* Enhanced hover shadow (consistent with WhatsApp) */
}

.floating-settings-button:active {
    transform: translateY(1px) scale(0.98); /* Consistent with WhatsApp */
    box-shadow: 0 2px 10px rgba(0,0,0,0.3); /* Consistent with WhatsApp */
}

.floating-settings-button img {
    width: 30px; /* Decreased icon size */
    height: 30px;
    display: block;
}

/* --- Settings Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Above other floating elements */
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.modal-content {
    background: rgba(20, 20, 20, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    width: 90vw;
    height: 90vh;
    max-width: 90vw;
    max-height: 90vh;
    color: white;
    text-align: center;
    position: relative;
    transform: translateY(-10px);
    animation: slideIn 0.3s forwards;
}

.modal-content #videoList {
    width: 100%;
    /* use flex so children (wrapper div + iframe) stretch to fill remaining modal space */
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    justify-content: center;
    height: calc(100% - 90px); /* leave space for headings/controls */
    box-sizing: border-box;
    overflow: hidden;
}
/* Ensure the wrapper inserted by JS stretches to fill available space */
.modal-content #videoList > div {
    display: flex;
    flex: 1 1 auto;
    min-height: 0; /* important for flex children to allow correct shrinking */
    align-items: center;
    justify-content: center;
}
/* Make iframe fully responsive and occupy all available space */
.modal-content #videoList iframe {
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    border: 0;
    display: block;
    max-height: 100%;
    min-height: 200px; /* keep usable minimum on very small screens */
    box-sizing: border-box;
    object-fit: contain;
}

.modal-content h2 {
    font-family: var(--title-font);
    font-size: calc(var(--base-font-size) * 1.6);
    margin-bottom: 25px;
    color: #DAA520;
}

.modal-content h3 {
    font-size: calc(var(--base-font-size) * 1.25);
    margin-top: 20px;
    margin-bottom: 15px;
    color: #f0f0f0;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    padding: 0 10px;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: #ff6b6b;
}

.settings-section {
    margin-bottom: 25px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}

.settings-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.font-family-options button,
.font-size-controls button {
    background: linear-gradient(45deg, #4CAF50, #DAA520);
    border: none;
    padding: 8px 15px;
    margin: 5px;
    color: white;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: calc(var(--base-font-size) * 0.9);
}

.font-family-options button:hover,
.font-size-controls button:hover {
    background: linear-gradient(45deg, #45a049, #B8860B);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.font-size-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#currentFontSize {
    font-size: calc(var(--base-font-size) * 1.125);
    font-weight: 600;
    color: #DAA520;
    min-width: 100px;
    display: inline-block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Media queries for smaller screens */
@media (max-width: 480px) {
  .letragrande {
    font-size: calc(var(--base-font-size) * 1.25); /* Slightly smaller for very small screens */
  }
  .consultaCompleta {
    font-size: calc(var(--base-font-size) * 1);
  }
  .result-box {
    font-size: calc(var(--base-font-size) * 1.5); /* Smaller for mobile */
    padding: 10px;
  }
  .result-box #arcanoDescription { /* Specific style for the description text on mobile */
    font-size: calc(var(--base-font-size) * 1.125); /* Smaller description text for mobile */
  }
  .result-box img {
    max-width: 180px; /* Adjust max-width if needed for smaller devices */
  }
  .button-group {
    flex-direction: column; /* Stack buttons vertically on very small screens */
    align-items: stretch; /* Make buttons full width */
  }
  input[type="button"], input[type="reset"], .email-button {
    margin: 5px 0; /* Add vertical margin between stacked buttons */
    min-width: unset; /* Remove min-width when stacked */
    font-size: calc(var(--base-font-size) * 0.9);
  }
  .floating-whatsapp-button {
    width: 40px; /* Further decreased for very small screens */
    height: 40px;
    bottom: 15px;
    right: 15px;
  }
  .floating-whatsapp-button img {
    width: 22px; /* Further decreased icon size for very small screens */
    height: 22px;
  }
  .floating-settings-button {
    width: 40px; /* Further decreased for very small screens */
    height: 40px;
    bottom: 65px; /* Adjusted position relative to smaller WhatsApp button on mobile */
    right: 15px;
  }
  .floating-settings-button img {
    width: 22px; /* Further decreased icon size */
    height: 22px;
  }
  .floating-home-button {
    bottom: 110px; /* Adjusted position for very small screens */
    right: 15px;
    width: 40px;
    height: 40px;
  }
  .floating-home-button svg {
    width: 20px;
    height: 20px;
  }

  /* Modal responsive adjustments */
  .modal-content {
      padding: 20px;
      width: 95%;
  }
  .modal-content h2 {
      font-size: calc(var(--base-font-size) * 1.4);
      margin-bottom: 20px;
  }
  .modal-content h3 {
      font-size: calc(var(--base-font-size) * 1.125);
      margin-top: 15px;
      margin-bottom: 10px;
  }
  .font-family-options button,
  .font-size-controls button {
      padding: 6px 12px;
      margin: 3px;
      font-size: calc(var(--base-font-size) * 0.85);
  }
  #currentFontSize {
      font-size: calc(var(--base-font-size) * 1);
      min-width: 80px;
  }
}