/* public/style.css */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f9ff;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

main {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 700px;
}

h1 {
    color: #007bff;
    font-size: 2.5rem;
}

.tagline {
    color: #555;
    margin-bottom: 30px;
}

.input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

#word-input {
    flex-grow: 1;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    font-size: 1.2rem;
}

#word-input:focus {
    outline: none;
    border-color: #007bff;
}

#explain-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 15px 25px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#explain-button:hover {
    background-color: #218838;
}

.output {
    background-color: #e9f5ff;
    border-left: 5px solid #007bff;
    padding: 20px;
    border-radius: 10px;
    text-align: left;
    min-height: 50px;
    line-height: 1.6;
    font-size: 1.1rem;
}

.language-selector legend {
    padding: 0 10px;
    font-weight: bold;
    color: #555;
}

.language-selector div {
    display: flex;
    align-items: center;
}

.language-selector label {
    margin-left: 5px;
    cursor: pointer;
}

.language-selector,
.age-selector {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px 25px;
    margin: 20px 0;
    text-align: left;
    flex: 1;
    min-width: 200px;
}

.language-selector legend,
.age-selector legend {
    padding: 0 10px;
    font-weight: bold;
    color: #555;
}


.language-selector div,
.age-selector div {
    display: block;
    margin-bottom: 12px;
}

.language-selector label,
.age-selector label {
    margin-left: 8px;
    cursor: pointer;
}

.language-selector div:last-child,
.age-selector div:last-child {
    margin-bottom: 0; /* No space after the last item */
}

#age-slider {
    width: 80%;
    margin-top: 10px;
    cursor: pointer;
}

#age-output {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
}

.hidden {
    display: none;
}

#new-definition-button {
    display: block; 
    margin: 20px auto 0;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #007bff;
    background-color: #e9f5ff;
    border: 2px solid #007bff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

#new-definition-button:hover {
    background-color: #007bff;
    color: white;
}

.google-signin-button {
    display: inline-block;
    background: #4285F4;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    margin-top: 20px;
    transition: background 0.2s;
}
.google-signin-button:hover {
    background: #357ae8;
}

.app-header {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 8px 15px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.signout-button {
    font-size: 0.9rem;
    color: #555;
    text-decoration: none;
    font-weight: bold;
}
.signout-button:hover {
    color: #000;
}

.dashboard-link {
    font-size: 0.9rem;
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}
.dashboard-link:hover {
    text-decoration: underline;
}

.dashboard-section {
    border-top: 1px solid #eee;
    margin-top: 30px;
    padding-top: 20px;
}
.status-message {
    margin-top: 10px;
    font-style: italic;
    color: #28a745;
}

/* in public/style.css -> REPLACE old history styles */
.history-container {
    text-align: left;
    margin-top: 20px;
}

.history-item {
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden; /* Important for the animation */
}

.history-header {
    background-color: #f8f9fa;
    padding: 1px 15px 1px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.history-header:hover {
    background-color: #f1f3f5;
}

.history-header .word-header {
    display: flex;
    align-items: baseline; /* Aligns the text nicely */
    gap: 8px; /* Adds space between elements */
    flex-wrap: wrap; /* Allows it to wrap on small screens */
}
.history-header .word-header .word {
    font-weight: bold;
    font-size: 1rem;
}
.history-header .word-header .meta {
    font-size: 0.8rem;
    color: #6c757d;
}

.history-body {
    padding: 0px 15px 0px 15px;
    border-top: 1px solid #eee;
    line-height: 1.2;
    /* This is the magic for the expand/collapse animation */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

/* This class will be added by JavaScript to expand the item */
.history-item.expanded .history-body {
    max-height: 500px; /* Adjust if explanations can be very long */
    padding: 1px 15px 1px 15px;
}

/* Add to the end of public/style.css */

.debug-output {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
    font-family: monospace;
    font-size: 0.8rem;
    white-space: pre-wrap; /* Allows long lines to wrap */
    word-break: break-all;
    text-align: left;
}


.settings-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Allows stacking on small screens */
    align-items: stretch; /* Makes the boxes the same height */
}

/* Make each fieldset take up equal space */
.settings-container .language-selector,
.settings-container .age-selector {
    flex: 1; 
    min-width: 200px; /* Prevents them from getting too squished */
}