/* --- General Page Structure --- */
body {
    font-family: 'Arimo', 'Noto Sans Symbols', sans-serif;
    color: #4d465a;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: transparent; /* Transparent to show canvas background */
}

/* Add this to gematria.css */
button,
input,
textarea,
select {
    font-family: inherit; /* This makes form elements use the 'Arimo' font */
}

.container {
    display: flex;
    justify-content: center;
    width: 100%;
    flex-grow: 1;
    background-color: #ffffff; /* Solid white background for content */
}

body[data-theme='dark'] .container {
    background-color: #1d1d1d; /* Solid dark background for content */
}

.content {
    max-width: 900px;
    width: 100%;
    padding: 20px;
}

.ad-pillar {
    width: 160px;
    background-color: transparent;
}

/* --- Glyph Canvas Styling --- */
#glyphCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind all content */
    pointer-events: none; /* Allow clicks to pass through */
}

/* --- Main Header Container --- */
.site-header-main {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 2rem 4rem;
    border-bottom: 1px solid rgba(200, 162, 200, 0.2);
    position: relative;
    background-color: transparent;
}

.header-column {
    padding: 0 1rem;
}

.header-column h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #c8a2c8; /* Lilac for dark mode */
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.header-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.header-column li {
    padding: 0.3rem 0;
}

.header-column a {
    color: #e0d8f0;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.header-column a:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(200, 162, 200, 0.9);
}

/* --- Light Mode Overrides --- */
body:not([data-theme='dark']) .header-column h4 {
    color: #4d465a;
}

body:not([data-theme='dark']) .header-column a {
    color: #5c546b;
}

body:not([data-theme='dark']) .header-column a:hover {
    color: #2a2431;
    text-shadow: none;
}

/* --- Page Content Styling --- */
.search-area {
    text-align: center;
    margin-bottom: 20px;
}

.search-area img {
    width: 100px;
    height: auto;
    margin-bottom: 10px;
}

.main-title {
    font-size: 24px;
    color: #8a2be2;
    text-shadow: 1px 1px 1px #d3d3d3;
    margin: 5px 0;
}

.subtitle {
    font-size: 18px;
    color: #333;
    margin-top: 0;
}

.info-text {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
}

#gematria-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#text-input, input[type="search"] {
    width: 300px;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

input[type="submit"] {
    padding: 8px 16px;
    border: 1px solid #999;
    background-color: #e0e0e0;
    cursor: pointer;
    border-radius: 4px;
}

/* --- Results Table Styling --- */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 20px;
}

.results-table caption {
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    margin-bottom: 10px;
    color: #333;
}

.results-table th, .results-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.results-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.results-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.results-table a {
    color: #0000ff;
    text-decoration: underline;
}

.social-buttons {
    text-align: center;
    margin: 20px 0;
}

/* --- Footer Styling --- */
footer {
    text-align: center;
    padding: 20px;
    background-color: #ffffff; /* Match the content box */
    width: 100%;
    border-top: 1px solid #eee;
}

body[data-theme='dark'] footer {
    background-color: #1d1d1d; /* Match the content box */
    color: #e0d8f0;
    border-top: 1px solid #333;
}

/* --- Calculation Breakdown Styling --- */
.breakdown-container {
    margin-bottom: 40px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fdfdfd;
}

body[data-theme='dark'] .breakdown-container {
    border-color: #444;
    background-color: #2c2c2c;
}

.breakdown-item {
    margin-bottom: 20px;
}

.breakdown-item:last-child {
    margin-bottom: 0;
}

.breakdown-item p {
    margin-top: 0;
    font-size: 16px;
    text-align: center;
}

.breakdown-table {
    width: auto;
    border-collapse: collapse;
    margin: 0 auto; /* This centers the table */
}

.breakdown-table td {
    padding: 4px 8px;
    text-align: center;
    min-width: 30px;
}

.breakdown-letters td {
    font-weight: bold;
    font-size: 1.2em;
    color: #8a2be2;
}

body[data-theme='dark'] .breakdown-letters td {
    color: #c8a2c8;
}

.breakdown-numbers td {
    border-top: 1px solid #ccc;
    font-size: 1em;
}

body[data-theme='dark'] .breakdown-numbers td {
    border-top-color: #555;
}

/* Add to gematria.css or in a <style> tag */
.cipher-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.cipher-table th, .cipher-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}
.cipher-table th {
    background: #f3eaff;
    color: #8a2be2;
    font-size: 1.1rem;
}
.cipher-table tr:last-child td {
    border-bottom: none;
}

/* Add this to your gematria.css file */

.breakdown-flex-container {
    display: flex;
    flex-wrap: wrap; /* This is the magic property that allows wrapping! */
    gap: 4px; /* Adds a small space between the letter cards */
    padding: 8px;
    background-color: #f7f7f9;
    border: 1px solid #e1e1e8;
    border-radius: 8px;
}

.letter-pair {
    display: flex;
    flex-direction: column; /* Stacks the letter on top of the number */
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #d1d1d8;
    border-radius: 5px;
    min-width: 35px; /* Ensures each card has a consistent width */
    padding: 5px 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.letter-pair .letter {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
}

.letter-pair .number {
    font-size: 0.9em;
    color: #555;
    margin-top: 2px;
}

/* You can also add other general styles for your page here */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

.results-table th, .results-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.results-table th {
    background-color: #f2f2f2;
}

.highlight {
    background-color: #fff3cd;
    font-weight: bold;
}