:root {
    --primary-color: #42a5f5;
    --primary-dark: #2980b9;
    --primary-light: #90caf9;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --light-text: #666;
    --white: #fff;
    --active-indicator: #4caf50;
    --hover-color: #e3f2fd;
    --border-color: #e0e0e0;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    color: var(--text-color);
    background-color: var(--secondary-color);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 0 !important; /* No padding needed since search bar is at top */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Search input at top of search modal */
.search-input-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #42a5f5;
    padding: 0 16px;
    z-index: 1002;
    box-shadow: 0 2px 16px rgba(66, 165, 245, 0.10);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 72px; /* Match header height */
    transform: translateY(-100%);
    transition: transform 0.3s ease-out;
}

.search-input-container {
    position: relative;
    flex: 1;
    max-width: 500px;
    margin: 0 auto;
}

.search-input-container input {
    width: 100%;
    padding: 16px 44px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    background: white;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 54px;
    transition: all 0.2s ease;
}

.search-button-left {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #42a5f5;
    cursor: default;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    z-index: 3;
    pointer-events: none;
}

#clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #42a5f5;
    font-size: 1.8rem;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

#clear-search.visible {
    opacity: 1;
    pointer-events: auto;
}

.cancel-button {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 12px;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 6px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.cancel-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Body styles are defined at the top of the file */

.header {
    background: #42a5f5;
    color: #fff;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    height: 72px; /* Match search bar height */
    display: flex;
    align-items: center;
    width: 100%;
}

.header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    position: relative;
    gap: 10px; /* Match search bar gap */
    max-width: none;
}

.header h1 {
    font-weight: 1000;
    margin: 0;
    font-size: 2.5rem;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    cursor: pointer;
}

.header-search-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.header-search-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

#alphabet-nav {
    background-color: #ffffff; /* Explicitly set to white */
    padding: 15px;
    border-radius: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.12); /* Enhanced shadow for better depth */
    margin-bottom: 2rem;
    border: 1px solid rgba(66, 165, 245, 0.2); /* Added subtle border */
}

.letter-btn {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #42a5f5; /* Darkened to match the header */
    color: var(--white);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(30, 136, 229, 0.25); /* Enhanced shadow to match button color */
}

.letter-btn:hover {
    background-color: #3498db;
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 165, 245, 0.3);
}

.letter-btn.active {
    background-color: #2980b9;
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(41, 128, 185, 0.4);
}

.letter-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #90caf9;
    color: white;
    box-shadow: none;
}

.letter-btn.disabled:hover {
    background-color: #90caf9;
    color: white;
    transform: none;
    box-shadow: none;
}

.content-area {
    background-color: var(--white); /* Keeping as white to contrast with the light blue body background */
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Enhanced shadow for better depth */
    min-height: auto; /* Changed from 400px to auto to prevent excessive space */
    margin-bottom: 2rem; /* Add margin at the bottom to show the background */
}

.letter-section {
    margin-bottom: 3rem;
}

.letter-header {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1.5rem;
    background-color: var(--primary-color);
    display: inline-block;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.letter-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    background-color: #3498db;
}

.word-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.word-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(66, 165, 245, 0.15);
    transform: translateY(-2px);
}

.word-header {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fafafa;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
}

.word-title-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1; /* Allow container to take up available space */
    min-height: 32px; /* Ensure minimum height for better tap target */
}

.word-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    padding: 4px 0; /* Add vertical padding for better tap target */
}

.copy-btn {
    background-color: #f0f5ff;
    border: 1px solid #e0e0e0;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    min-width: 32px;
    min-height: 32px;
    z-index: 2; /* Ensure button stays above other elements for click handling */
    position: relative;
}

.copy-btn:hover {
    background-color: rgba(66,165,245,0.2);
    border-color: var(--primary-color);
}

.copy-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    z-index: 9999;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.copy-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.chevron {
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--light-text);
    border-bottom: 2px solid var(--light-text);
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    display: inline-block;
    margin-left: 8px;
}

.chevron.rotated {
    transform: rotate(-135deg); /* Upward when expanded */
}

.word-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.word-content.expanded {
    max-height: 500px; /* Increased max-height to accommodate more content */
    padding: 1.25rem;
}

/* Type Badge Styles */
.word-type-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}

.word-type {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.word-type:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.type-aussie {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.type-genz {
    background-color: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #ce93d8;
}

.type-emoji {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffcc02;
}

.type-texting {
    background-color: #fce4ec;
    color: #c2185b;
    border: 1px solid #f8bbd0;
}

.type-internet {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.meaning {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 1.5rem; /* Increased margin-bottom */
    line-height: 1.6;
    padding-bottom: 0.75rem; /* Added padding bottom */
    border-bottom: 1px solid var(--border-color); /* Added a light border */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.meaning::before {
    content: "📚 Meaning:";
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.example {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    font-style: italic;
    color: var(--light-text);
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.example::before {
    content: "💬 Example:"; /* Updated content with emoji at start */
    font-weight: 600; /* Added font-weight */
    font-style: normal; /* Reset font-style for the pseudo-element */
    display: block; /* Made it block to appear on its own line */
    margin-bottom: 0.5rem; /* Added margin below the heading */
    color: var(--primary-dark); /* Matched color with meaning heading */
}

/* Essential utility classes to replace Bootstrap */
.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
    max-width: 750px;
}

.first-container {
    padding-top: 82px; /* Add padding equal to header height plus some extra space */
}

.main-content-container {
    padding-top: 0; /* Remove padding since we're handling it in the first container */
}

.text-center {
    text-align: center;
}

.display-4 {
    font-size: 3.5rem;
    font-weight: 300;
    line-height: 1.2;
}

.fw-bold {
    font-weight: 700;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

@media (max-width: 576px) {
    .display-4 {
        font-size: 2.5rem;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 0;
        border-radius: 0 !important;
        height: 72px; /* Keep consistent with search bar */
    }
    .header-content {
        padding: 0 16px;
    }
    .search-input-top {
        padding: 0 16px;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    #alphabet-nav {
        padding: 10px;
        gap: 4px;
    }
    
    .letter-btn {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
    
    .content-area {
        padding: 1.5rem;
    }
    
    .word-header {
        padding: 1rem;
    }
    
    .word-title {
        font-size: 1.1rem;
    }
    
    .word-content.expanded {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0;
        border-radius: 0 !important;
        height: 72px; /* Keep consistent with search bar */
    }
    .header-content {
        padding: 0 16px;
    }
    .search-input-top {
        padding: 0 16px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .letter-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .content-area {
        padding: 1rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Jump List Styles */
#jump-list-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    user-select: none;
}

#jump-list {
    background-color: var(--white);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1001;
    animation: fadeIn 0.3s ease;
    border-top: 3px solid var(--primary-color);
    user-select: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#jump-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: var(--primary-color);
    border-radius: 4px;
    color: white;
    user-select: none;
}

#jump-list-header h3 {
    margin: 0;
    color: white;
    font-weight: 500;
    font-size: 1.1rem;
    user-select: none;
}

#close-jump-list {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 0;
    margin: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
}

#close-jump-list:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

#jump-list-content {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    user-select: none;
}

.jump-letter-btn {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 1.2rem;
    user-select: none;
}

.jump-letter-btn:hover, .jump-letter-btn:focus {
    background-color: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.jump-letter-btn.disabled {
    opacity: 0.4; /* Reverted to original disabled opacity */
    background-color: #90caf9; /* Reverted to original disabled background (var(--primary-light)) */
    color: rgb(0, 0, 0); /* Reverted to original disabled text color */
    cursor: not-allowed;
    border: 3px solid #3498db; /* Added border as requested */
    box-shadow: none; /* Ensured original disabled box-shadow */
}

.jump-letter-btn.disabled:hover {
    background-color: #90caf9; /* Lighter blue */
    color: rgb(0, 0, 0); /* Reverted to original disabled text color */
    transform: none;
    box-shadow: none;
    border: 3px solid #3498db; /* Added border as requested */
}

/* Loading animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--light-text);
    font-size: 1.1rem;
}

.loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

/* Style for emoji icon in section header */
img.section-emoji-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1); /* Make it white to match text */
    vertical-align: middle;
}

/* Styling for emoji icon in jump button */
img.emoji-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1); /* Make it white to match other letters */
}

@keyframes dots {
    0%, 20% {
        color: rgba(0,0,0,0);
        text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0);
    }
    40% {
        color: var(--light-text);
        text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0);
    }
    60% {
        text-shadow: .25em 0 0 var(--light-text), .5em 0 0 rgba(0,0,0,0);
    }
    80%, 100% {
        text-shadow: .25em 0 0 var(--light-text), .5em 0 0 var(--light-text);
    }
}

/* Section highlight animation */
@keyframes highlightSection {
    0% { box-shadow: 0 0 0 rgba(255, 202, 40, 0); }
    30% { box-shadow: 0 0 20px rgba(255, 202, 40, 0.5); }
    100% { box-shadow: 0 0 0 rgba(255, 202, 40, 0); }
}

.highlight-section {
    animation: highlightSection 1.5s ease-out;
}

/* Search Modal Styles */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #42a5f5;
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.2s ease-in-out;
    opacity: 0;
}

.search-modal.visible {
    opacity: 1;
}

.search-container {
    position: fixed;
    top: 72px; /* Match new header height */
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
    overflow-y: auto;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.search-modal.visible .search-input-top {
    transform: translateY(0);
}

.search-modal.visible .search-container {
    opacity: 1;
}

.search-results {
    padding: 0;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: calc(100vh - 72px); /* Full height minus new header height */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Add modest bottom padding for 1-2 results */
.search-results:has(.search-result-item):has(.search-result-item:nth-child(-n+2):last-child) {
    padding-bottom: 40px;
}

/* Add more bottom padding for 3+ results */
.search-results:has(.search-result-item:nth-child(3)) {
    padding-bottom: 400px;
}

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    background-color: white;
}

.result-content {
    flex: 1;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-word {
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-word img, 
.result-word span {
    display: inline-block;
    vertical-align: middle;
}

.result-search-icon {
    background: none;
    border: none;
    color: #42a5f5;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.result-search-icon:hover {
    color: #2980b9;
    background-color: rgba(66, 165, 245, 0.1);
}

.start-typing {
    color: var(--light-text);
    font-size: 1rem;
    text-align: center;
    padding: 2rem 1rem;
    background: white;
    user-select: none;
}

.no-results {
    color: var(--light-text);
    font-size: 1rem;
    text-align: center;
    padding: 2rem 1rem;
    background: white;
    position: sticky;
    top: 0;
    user-select: none;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.save-image-btn, .share-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background-color 0.2s ease;
    flex: 1;
    min-width: 120px;
}

.save-image-btn:hover, .share-btn:hover {
    background-color: #3498db;
}

.save-image-btn img, .share-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1); /* Make SVG icon white */
}

.card-image-container {
    position: relative;
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-image-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.card-image-header img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.card-image-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.card-image-content {
    margin-bottom: 15px;
}

.card-image-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.card-image-footer img {
    height: 20px;
}

.card-image-footer span {
    font-size: 0.9rem;
    color: #666;
}

/* Save instructions modal for iOS users */
.save-instructions-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.save-instructions-content {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 350px;
    text-align: center;
}

.save-instructions-content h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
}

.save-instructions-content p {
    margin-bottom: 20px;
    color: var(--text-color);
    line-height: 1.4;
}

.primary-btn, .secondary-btn {
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    margin: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: #2980b9;
}

.secondary-btn {
    background-color: #f5f5f5;
    color: #42a5f5;
    border: 1px solid #42a5f5;
}

.secondary-btn:hover {
    background-color: #e3f2fd;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 998;
    -webkit-tap-highlight-color: transparent;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
}

/* Terms of the Day styles */
.terms-of-day-container {
    background-color: var(--white);
    border-radius: 15px;
    padding: 0.5rem 1rem 0.75rem 1rem; /* Reduced top padding */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem; /* Increased spacing between this and the main content */
    margin-top: 0.25rem; /* Remove any top margin as it's handled by the container */
}

.terms-of-day-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-top: 0; /* Ensure no top margin */
    margin-bottom: 0.5rem;
}

.terms-of-day-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding-bottom: 0.15rem;
}

.terms-of-day-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.terms-of-day-content {
    display: flex;
    gap: 0.6rem;
    padding-bottom: 0.1rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.term-of-day-card {
    min-width: 250px;
    background-color: var(--hover-color);
    border-radius: 12px;
    padding: 0.75rem;
    border-left: 4px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.term-of-day-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 165, 245, 0.2);
    background-color: var(--hover-color);
    border-left: 4px solid var(--primary-dark);
}

.term-of-day-word {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.35rem;
}

.term-of-day-meaning {
    font-size: 0.85rem;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

/* Filter Bar Styles */
.filter-bar-container {
    margin: 0.5rem 0 1.25rem 0;
    width: 100%;
    overflow: hidden;
}

.filter-bar-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding-bottom: 0.15rem;
}

.filter-bar-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.filter-btn {
    background: #eaf4ff; /* Light blue background matching terms of the day */
    color: var(--primary-color);
    border: 1px solid var(--primary-light); /* Add a light border */
    border-radius: 20px;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    outline: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(66, 165, 245, 0.08);
}

.filter-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color); /* Match border to active background */
}

.filter-btn:hover:not(.active) {
    background: #eaf4ff;
    color: var(--primary-color);
    border-color: var(--primary-dark); /* Darker border on hover */
}

.badge-internet {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #a5b4fc;
}