
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    display: flex;
    flex-direction: column; 
    min-height: 100vh;
    background-color: #f0f4f8; 
    color: #333;
}

.page-header {
    background-color: #ffffff;
    padding: 15px 30px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-bottom: 2px solid #007bff; 
    flex-shrink: 0; 
}
.page-header h1 {
    margin: 0;
    font-size: 2.2em;
    color: #FF8C00; 
    display: flex; /* For aligning button next to word */
    align-items: center;
    justify-content: center;
}
.speak-button {
    background: none;
    border: none;
    font-size: 1.2em; /* Relative to H1 font size */
    padding: 0 0 0 10px; /* Space from word */
    cursor: pointer;
    color: #007bff;
    line-height: 1; /* Align better with text */
}
.speak-button:hover {
    color: #0056b3;
}
.speak-button-inline { /* For IPA line */
    background: none;
    border: none;
    font-size: 1em;
    padding: 0 0 0 5px;
    cursor: pointer;
    color: #007bff;
}


.content-container { 
    flex-grow: 1; 
    width: 100%;
    max-width: 1400px; 
    margin: 20px auto; 
    padding: 0 20px; 
    box-sizing: border-box;
}

.top-content-area {
    display: flex;
    flex-direction: row; 
    gap: 25px; 
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.07);
}

.text-details-area {
    flex: 1 1 60%; 
    min-width: 300px; 
}
.image-area {
    flex: 1 1 40%; 
    min-width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; 
    padding-top: 10px;
}

.section-title {
    color: #0366d6; 
    font-weight: 600; 
    font-size: 1.2em;
    margin-top: 20px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 5px;
}
.text-details-area ul { padding-left: 20px; list-style-type: disc; } /* Ensure list style */
.text-details-area ul li { margin-bottom: 6px; line-height: 1.7;} /* Improved line height */
.text-details-area p { line-height: 1.6; margin-bottom: 10px;}
.example-sentence { font-style: italic; color: #24292e; }
.example-translation { color: #586069; font-size: 0.95em; margin-left: 15px; display: block; margin-bottom: 10px;}

.word-image { 
    max-width: 100%; 
    max-height: 350px; 
    height: auto; 
    margin-bottom: 20px; 
    border: 1px solid #e1e4e8;
    padding: 8px;
    border-radius: 8px;
    background-color: #f9f9f9; 
    object-fit: contain; 
    display: block; 
}
.placeholder-image { 
    width: 100%; 
    max-width: 300px; 
    min-height: 220px;
    background-color: #f0f0f0;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    margin: 20px auto; 
}
.placeholder-image-text {
    color: #777;
    font-style: italic;
}

.bottom-navigation {
    background-color: #ffffff;
    padding: 20px;
    border-top: 1px solid #d1d5da;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
    flex-shrink: 0; 
    text-align: center; 
}
.bottom-navigation h3 {
    color: #0366d6; margin-top: 0; font-size: 1.3em;
    margin-bottom: 15px;
}
.bottom-navigation #bottomSearchInput {
    width: calc(80% - 22px); 
    max-width: 400px; 
    padding: 10px; margin: 0 auto 15px auto; 
    border: 1px solid #d1d5da; border-radius: 6px; box-sizing: border-box;
    display: block; 
}
.bottom-navigation ul {
    list-style-type: none; padding: 0;
    max-height: 200px; 
    overflow-y: auto;
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    display: inline-block; 
    text-align: left; 
    padding: 10px;
}
.bottom-navigation li a {
    text-decoration: none; color: #0366d6; display: block;
    padding: 6px 10px; border-radius: 4px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}
.bottom-navigation li a:hover, .bottom-navigation li a.active {
    background-color: #f0f4f8; color: #005cc5;
}
.nav-home-link-bottom {
    display: inline-block; 
    margin-top: 10px; padding: 10px 15px; 
    background-color: #28a745; 
    color: white !important; 
    text-decoration: none; border-radius: 5px;
}
.nav-home-link-bottom:hover { background-color: #218838; }

.page-footer {
    text-align: center; padding: 15px; background-color: #e9ecef; 
    border-top: 1px solid #ced4da; color: #6c757d;
    width: 100%; box-sizing: border-box;
    flex-shrink: 0; 
    font-size: 0.9em;
}
.page-footer a { color: #007bff; text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }

/* Index Page Specific Styles */
.index-header {
    background-color: #0366d6; color: white; padding: 30px 20px;
    text-align: center; margin-bottom: 30px;
    flex-shrink: 0;
}
.index-header h1 { font-size: 2.8em; margin-bottom: 5px; }
.index-header p { font-size: 1.2em; opacity: 0.9; }
.word-groups { 
    display: flex; flex-wrap: wrap; gap: 25px; justify-content: center;
    padding: 0 20px 20px 20px; 
    max-width: 1200px; margin: 0 auto;
    flex-grow: 1; 
}
.group-card {
    background-color: #ffffff; border: 1px solid #d1d5da; border-radius: 8px;
    padding: 20px; width: calc(33.333% - 30px); min-width: 280px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.group-card:hover { transform: translateY(-5px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.group-card h2 {
    margin-top: 0; color: #0366d6; border-bottom: 1px solid #eaecef;
    padding-bottom: 10px; font-size: 1.5em;
}
.group-card ul { list-style-type: none; padding: 0; max-height: 250px; overflow-y: auto; }
.group-card li { margin-bottom: 8px; }
.group-card li a { text-decoration: none; color: #24292e; font-weight: 500; }
.group-card li a:hover { color: #0366d6; text-decoration: underline; }

/* Responsive adjustments */
@media (max-width: 992px) { 
    .top-content-area {
        flex-direction: column; 
    }
    .text-details-area { margin-bottom: 20px; }
    .image-area { padding-top: 0; } 
}
@media (max-width: 768px) { 
    .page-header h1 { font-size: 1.8em; }
    .content-container { padding: 0 15px; margin: 15px auto; }
    .top-content-area { padding: 20px; }
    .bottom-navigation #bottomSearchInput { width: calc(90% - 22px); }
    .bottom-navigation ul { padding: 5px; max-height: 150px; }
}
@media (max-width: 600px) {
    .group-card { width: calc(100% - 20px); } 
    .page-header h1 { font-size: 1.6em; }
    .section-title {font-size: 1.1em;}
    .text-details-area, .image-area, .bottom-navigation { padding: 15px; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }
