/* Pigpen Cipher Translator - Enhanced Styles */
    
/* Custom font declaration */
@font-face {
    font-family: 'BabelStonePigpen';
    src: url('BabelStonePigpen.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Using the color scheme from your CSS */
:root {
    --primary-color: #cb997e;
    --secondary-color: #6b705c;
    --accent-color: #a5a58d;
    --light-color: #f5f3ef;
    --dark-color: #4a4e69;
    --text-color: #3d405b;
    --bg-color: #f9f7f3;
    --border-color: #e3d5ca;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.5;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background-color: white;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 2rem;
    text-align: center;
}

h2 {
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem 0;
}

h3 {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 1.1rem;
    margin: 1.2rem 0 0.8rem 0;
}

.description {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark-color);
    font-size: 1rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.translator-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: center; /* Center items horizontally */
}

.input-container, .output-container {
    width: 100%;
    position: relative;
    max-width: 800px; /* Limit width for better readability */
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    resize: vertical;
    outline: none;
    border-radius: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(203, 153, 126, 0.2);
}

.output-display {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    background-color: white;
    font-family: 'BabelStonePigpen', fallback, sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    line-height: 1.6;
    border-radius: 4px;
}

.button-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
    max-width: 800px;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover {
    background-color: var(--primary-color);
}

button:active {
    transform: scale(0.98);
}

.example-btn {
    background-color: var(--accent-color);
    margin: 1rem auto;
    display: block;
}

.tooltip {
    display: none;
    position: absolute;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 100;
}

.info-section, .additional-info, .faq-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.info-section p, .additional-info p, .faq-section p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* Style for the reference section */
.reference-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 100%;
    max-width: 800px;
    text-align: center; /* Center the content inside */
}

.reference-section h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 1.1rem;
}

.alphabet-reference {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center; /* Center alphabet reference */
}

.reference-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
}

.reference-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40px;
    height: 65px;
}

.letter {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 0.3rem;
    color: var(--text-color);
}

.pigpen-letter {
    font-size: 1.2rem;
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: 4px;
    padding: 0.3rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* FAQ styles */
.faq-item {
    background-color: var(--light-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.faq-item h3 {
    color: var(--secondary-color);
    margin-top: 0;
    font-size: 1rem;
}

.credits {
    font-size: 0.8rem;
    color: var(--dark-color);
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.credits a {
    color: var(--primary-color);
    text-decoration: none;
}

.credits a:hover {
    text-decoration: underline;
}

.font-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .translator-container {
        flex-direction: column; /* Change to column to have textboxes stack */
    }
    
    .input-container, .output-container {
        width: 100%;
        margin-bottom: 1rem;
    }
}

@media (max-width: 767px) {
    .container {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .button-container {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .reference-row {
        justify-content: center;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    
    .button-container, .input-container, .credits, .info-section, .additional-info, .faq-section {
        display: none;
    }
    
    .output-display {
        border: none;
        font-size: 2rem;
    }
    
    .reference-section {
        page-break-inside: avoid;
    }
}

/* Animation for focus effect */
@keyframes focusPulse {
    0% { box-shadow: 0 0 0 0 rgba(203, 153, 126, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(203, 153, 126, 0); }
    100% { box-shadow: 0 0 0 0 rgba(203, 153, 126, 0); }
}

.input-container:focus-within textarea {
    animation: focusPulse 1.5s ease-out;
}