/* base */
html {
    background: rgb(251, 251, 251);
}

body {
    padding: 20px;
    font-family: Arial, serif;
    font-size: 17px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
}

a {
    text-decoration: none;
    color: #3c60f1;
}

/* header */
.nav-container {
    padding-left: 0;
    margin-bottom: 0;
    background: #f8f8f8;
    position: relative;
    z-index: 1000;
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1001;
}

.nav-header .title h1 {
    margin-left: 10px;
    margin-top: 0;
    margin-bottom: 0;
}

.nav-header .title a {
    color: black;
}

.nav-header .logo img {
    height: 46px;
}

.nav-header nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    padding: 0;
    margin: 0;
}

.nav-header nav ul li {
    display: inline;
}

.nav-header nav ul li a {
    text-decoration: none;
    color: black;
    font-weight: bold;
    padding: 5px 10px;
}

.nav-header nav ul li a:hover {
    color: #3c60f1;
}

.nav-header .menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-header .menu-toggle div {
    width: 25px;
    height: 3px;
    background: black;
    margin: 5px 0;
}

@media (max-width: 768px) {
    .nav-header nav {
        position: relative;
    }
    
    .nav-header nav ul {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 90px;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        text-align: center;
        padding: 15px 0;
        z-index: 1002;
    }
    
    .nav-header nav ul.active {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .nav-header nav ul li {
        padding: 15px;
        width: 100%;
    }
    
    .nav-header nav ul li a {
        display: block;
        font-size: 18px;
        padding: 10px;
        width: 100%;
    }
    
    .nav-header .menu-toggle {
        display: flex;
    }
}


/* body */
.container {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.container.main {
    margin-top: 20px;
}

.dictionary-content .search-area #search-field {
    font-size: 18px;
    line-height: 24px;
    max-width: 100%;
}

.dictionary-content .search-area .match-type {
    margin-top: 4px;
}

.dictionary-content input[type="submit"] {
    font-size: 20px;
}

.dictionary-content .result {
    margin-bottom: 48px;
}

.dictionary-content .definition, .page-about {
    line-height: 32px;
}

.tib_3, a.tib_3 {
    font-family: "Noto Serif Tibetan", serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

.dictionary-content .definition .tib_3, .page-about .tib_3, .dictionary-content .tib_3 {
    font-size: 16px;
}

.dictionary-content .definition hr {
    margin-left: 0;
    margin-top: 10px;
    margin-bottom: 5px;
    line-height: 0;
    border: 1px solid #ddd;
    border-top: none;
}

.dictionary-content .defined-term {
    font-size: 24px;
    line-height: 40px;
    font-family: "Noto Serif Tibetan", serif;
    font-weight: 400;
    font-style: normal;
}

.dictionary-content .transliteration {
    font-size: 15px;
    color: #5a5a5a;
    margin-bottom: 14px;
}

.search-card {
    max-width: 500px;
    margin: 40px auto;
    padding: 20px;
    background: #ffffff;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: center;
}

.search-area form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#search-field {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

input[type="submit"] {
    background-color: #b14322;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

input[type="submit"]:hover {
    background-color: #a04124;
}

.match-type {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.match-type label {
    cursor: pointer;
}

.match-type input[type="radio"] {
    cursor: pointer;
}

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

.mb-4 {
    margin-bottom: 40px;
}

.mt-4 {
    margin-top: 40px;
}

.mt-5 {
    margin-top: 60px;
}

.fs-24 {
    font-size: 24px;
}

.cormorant-garamond-light {
    font-family: "Cormorant Garamond", serif;
    font-weight: 300;
    font-style: normal;
}
  
.cormorant-garamond-regular {
    font-family: "Cormorant Garamond", serif;
    font-weight: 400;
    font-style: normal;
}
  
.cormorant-garamond-medium {
    font-family: "Cormorant Garamond", serif;
    font-weight: 500;
    font-style: normal;
}
  
.cormorant-garamond-semibold {
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
    font-style: normal;
}
  
.cormorant-garamond-bold {
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
    font-style: normal;
}
  
.cormorant-garamond-light-italic {
    font-family: "Cormorant Garamond", serif;
    font-weight: 300;
    font-style: italic;
}
  
.cormorant-garamond-regular-italic {
    font-family: "Cormorant Garamond", serif;
    font-weight: 400;
    font-style: italic;
}
  
.cormorant-garamond-medium-italic {
    font-family: "Cormorant Garamond", serif;
    font-weight: 500;
    font-style: italic;
}
  
.cormorant-garamond-semibold-italic {
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
    font-style: italic;
}
  
.cormorant-garamond-bold-italic {
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
    font-style: italic;
}

/* Browse Widget Styles */
.browse-widget {
    margin-top: 30px;
    position: relative;
}

.alphabet-top {
    width: 100%;
    background-color: #f8f8f8;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.alphabet-char {
    font-family: "Noto Serif Tibetan", serif;
    font-size: 20px;
    text-align: center;
    padding: 5px 0;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 5px;
    text-decoration: none;
    display: inline-block;
}

.alphabet-char:hover {
    color: #3c60f1;
    transform: scale(1.2);
}

.alphabet-char.active {
    color: #3c60f1;
    font-weight: bold;
}

/* Old infinite scroll styles */
.infinite-scroll-container {
    position: relative;
    min-height: 400px;
}

.loading-spinner {
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3c60f1;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* New browse widget styles */
.browse-widget-container {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 15px;
    background-color: #fff;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

.browse-widget .entries-container {
    width: 100%;
    margin: 15px 0;
}

.browse-widget .pagination {
    text-align: center;
    padding: 10px 0;
}

.browse-widget .pagination.top-pagination {
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.browse-widget .pagination.bottom-pagination {
    border-top: 1px solid #eee;
    margin-top: 15px;
}

.browse-widget .pagination .step-links {
    display: inline-block;
}

.browse-widget .pagination a {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #f8f8f8;
    text-decoration: none;
}

.browse-widget .pagination a:hover {
    background-color: #e9e9e9;
}

.browse-widget .pagination .current {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px;
}

.browse-widget .jump-to-page-form {
    display: inline-block;
    margin-left: 10px;
}

.browse-widget .jump-to-page-form input[type="number"] {
    width: 50px;
    text-align: center;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.browse-widget .jump-to-page-form button {
    padding: 4px 8px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.browse-widget .jump-to-page-form button:hover {
    background-color: #e9e9e9;
}

@media (max-width: 768px) {
    /* Mobile styles for browse widget */
    .browse-widget .pagination {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .browse-widget .pagination .step-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        width: 100%;
    }
    
    .browse-widget .pagination a {
        padding: 4px 8px;
        font-size: 14px;
        margin-bottom: 5px;
        flex: 0 0 auto;
    }
    
    .browse-widget .pagination .current {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .browse-widget .jump-to-page-form {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .browse-widget .jump-to-page-form label {
        margin-right: 5px;
    }
    
    .browse-widget .alphabet-top {
        padding: 5px;
    }
    
    .browse-widget .alphabet-char {
        font-size: 18px;
        margin: 0 3px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .browse-widget .pagination a {
        padding: 3px 6px;
        font-size: 12px;
    }
    
    .browse-widget .jump-to-page-form {
        flex-direction: column;
    }
    
    .browse-widget .jump-to-page-form label,
    .browse-widget .jump-to-page-form input,
    .browse-widget .jump-to-page-form button {
        margin: 2px 0;
    }
}

/* Paywall Styles */
.paywall-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

.paywall-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.paywall-header {
    background: #b14322;
    color: white;
    padding: 30px;
    text-align: center;
}

.paywall-header h2 {
    margin: 0;
    font-size: 2em;
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
}

.paywall-body {
    padding: 40px;
}

.paywall-title {
    font-size: 1.8em;
    margin: 20px 0;
    color: #333;
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
}

.paywall-subtitle {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
}

.paywall-info-box {
    background: #f8f8f8;
    border-left: 4px solid #b14322;
    padding: 20px;
    margin: 30px 0;
    border-radius: 5px;
}

.paywall-info-box h5 {
    margin: 0 0 10px 0;
    color: #b14322;
    font-size: 1.2em;
    font-family: "Cormorant Garamond", serif;
}

.paywall-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

@media (max-width: 768px) {
    .paywall-options {
        grid-template-columns: 1fr;
    }
}

.paywall-option {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
}

.paywall-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.paywall-option h4 {
    font-size: 1.4em;
    margin: 15px 0;
    color: #333;
    font-family: "Cormorant Garamond", serif;
}

.paywall-option p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.paywall-btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.paywall-btn-primary {
    background-color: #b14322;
    color: white;
}

.paywall-btn-primary:hover {
    background-color: #a04124;
}

.paywall-btn-secondary {
    background-color: #3c60f1;
    color: white;
}

.paywall-btn-secondary:hover {
    background-color: #2d4bc9;
}

.paywall-btn-tertiary {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
}

.paywall-btn-tertiary:hover {
    background: #e0e0e0;
}

.paywall-register-link {
    margin-top: 15px;
    font-size: 0.9em;
    color: #666;
}

.paywall-register-link a {
    color: #3c60f1;
    text-decoration: none;
    font-weight: 600;
}

.paywall-register-link a:hover {
    text-decoration: underline;
}

.paywall-benefits {
    background: #f8f8f8;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
}

.paywall-benefits h5 {
    font-size: 1.2em;
    margin: 0 0 15px 0;
    color: #333;
    font-family: "Cormorant Garamond", serif;
}

.paywall-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.paywall-benefits li {
    padding: 8px 0;
    color: #555;
    font-size: 1em;
}

.paywall-benefits li::before {
    content: "✓ ";
    color: #b14322;
    font-weight: bold;
    font-size: 1.2em;
    margin-right: 10px;
}

/* Login Page Styles */
.login-card {
    max-width: 500px;
    margin: 40px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-header {
    background: #b14322;
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header h2 {
    margin: 0 0 10px 0;
    font-size: 2em;
}

.login-header p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.login-body {
    padding: 40px;
}

.login-error {
    background: #fee;
    border-left: 4px solid #c33;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.login-error p {
    margin: 0;
    color: #c33;
}

.login-info {
    background: #e8f4f8;
    border-left: 4px solid #3c60f1;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.login-info p {
    margin: 0;
    color: #2d4bc9;
}

.login-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #3c60f1;
    box-shadow: 0 0 0 3px rgba(60, 96, 241, 0.1);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background-color: #b14322;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background-color: #a04124;
}

.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-footer p {
    margin: 10px 0;
    color: #666;
}

.login-footer a {
    color: #3c60f1;
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .login-card {
        margin: 20px;
    }
    
    .login-body {
        padding: 30px 20px;
    }
    
    .login-header {
        padding: 20px;
    }
    
    .login-header h2 {
        font-size: 1.5em;
    }
}

/* Profile Page Styles */
.profile-container {
    max-width: 800px;
    margin: 40px auto;
}

.profile-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.profile-header {
    background: #b14322;
    color: white;
    padding: 30px;
    text-align: center;
}

.profile-header h2 {
    margin: 0 0 10px 0;
    font-size: 2em;
}

.profile-header p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.profile-body {
    padding: 40px;
}

.profile-messages {
    margin-bottom: 30px;
}

.profile-message {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    border-left: 4px solid;
}

.profile-message-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.profile-message-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.profile-message-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.profile-message-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section-title {
    font-size: 1.4em;
    margin: 0 0 20px 0;
    color: #333;
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.profile-info-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 5px;
    border-left: 3px solid #b14322;
}

.profile-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-value {
    font-size: 1.1em;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.profile-badge-success {
    background: #d4edda;
    color: #155724;
}

.profile-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.profile-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.profile-btn {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.profile-btn-primary {
    background-color: #b14322;
    color: white;
}

.profile-btn-primary:hover {
    background-color: #a04124;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(177, 67, 34, 0.3);
}

.profile-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.profile-btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

@media (max-width: 768px) {
    .profile-container {
        margin: 20px;
    }
    
    .profile-body {
        padding: 30px 20px;
    }
    
    .profile-header {
        padding: 20px;
    }
    
    .profile-header h2 {
        font-size: 1.5em;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .profile-btn {
        width: 100%;
    }
}
