/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Georgia', serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
}

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
}

.user-info {
    font-size: 1rem;
}

.user-info a {
    color: #3498db;
    text-decoration: none;
}

.user-info a:hover {
    text-decoration: underline;
}

/* Login Form Styles */
.login-form {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-form h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #34495e;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.demo-note {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

/* Search Container */
.search-container {
    margin-bottom: 20px;
}

.search-container form {
    display: flex;
}

.search-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.search-container button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
}

/* Mode Switcher */
.mode-switcher {
    display: flex;
    margin-bottom: 20px;
}

.mode-switcher button,
.mode-switcher a button {
    padding: 10px 20px;
    background-color: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
    cursor: pointer;
    font-size: 1rem;
}

.mode-switcher button:first-child,
.mode-switcher a button:first-child {
    border-radius: 4px 0 0 4px;
}

.mode-switcher button:last-child,
.mode-switcher a button:last-child {
    border-radius: 0 4px 4px 0;
}

.mode-switcher button.active,
.mode-switcher a button.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* Dictionary Container */
.dictionary-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alphabet-nav {
    margin-bottom: 20px;
    text-align: center;
}

.alphabet-nav a {
    display: inline-block;
    margin: 0 5px;
    padding: 5px 10px;
    background-color: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.alphabet-nav a:hover {
    background-color: #3498db;
    color: white;
}

.letter-section {
    margin-bottom: 30px;
}

.letter-section h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.word-entry {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.word-entry:last-child {
    border-bottom: none;
}

.word-entry h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.pronunciation {
    font-style: italic;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.word-type {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.indonesian-word {
    font-weight: bold;
    margin-bottom: 10px;
}

.definition {
    margin-bottom: 10px;
}

.example {
    margin-left: 20px;
    font-style: italic;
}

.example-conlang {
    margin-bottom: 5px;
}

.example-indonesian {
    color: #7f8c8d;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination a {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    background-color: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.pagination a:hover {
    background-color: #3498db;
    color: white;
}

.pagination a.active {
    background-color: #3498db;
    color: white;
}

/* Edit Mode Styles */
.edit-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.edit-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.word-list table {
    width: 100%;
    border-collapse: collapse;
}

.word-list th,
.word-list td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.word-list th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.word-list tr:hover {
    background-color: #f8f9fa;
}

.edit-btn, .delete-btn {
    padding: 6px 12px;
    margin-right: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.edit-btn {
    background-color: #3498db;
    color: white;
}

.edit-btn:hover {
    background-color: #2980b9;
}

.delete-btn {
    background-color: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background-color: #c0392b;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #e74c3c;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.form-actions button {
    margin-left: 10px;
}

.cancel-btn, .cancel-delete-btn {
    background-color: #95a5a6;
}

.cancel-btn:hover, .cancel-delete-btn:hover {
    background-color: #7f8c8d;
}

.delete-confirm {
    background-color: #e74c3c;
}

.delete-confirm:hover {
    background-color: #c0392b;
}

/* Search Results */
.search-results {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999;
    overflow: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.search-results h2 {
    color: white;
    margin-bottom: 20px;
}

#results-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    flex: 1;
    overflow: auto;
}

#close-search {
    align-self: flex-end;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

#close-search:hover {
    background-color: #c0392b;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    header h1 {
        margin-bottom: 10px;
    }
    
    .edit-actions {
        flex-direction: column;
    }
    
    .search-container {
        margin-top: 10px;
    }
    
    .word-list {
        overflow-x: auto;
    }
    
    .modal-content {
        width: 95%;
    }
}