body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1, h2 {
    color: #2c3e50;
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* Important for padding */
    font-size: 16px; /* Prevents auto-zoom on iOS */
}

button {
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    text-align: center;
    transition: opacity 0.5s ease-out;
}

.alert-fade {
    opacity: 0;
}

.alert-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

.alert-danger {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

/* Admin Styles */
.list-container {
    display: flex;
    flex-direction: row;
    gap: 30px;
}

.list-container section {
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
}

.word-list {
    list-style: none;
    padding: 0;
}
.word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease-in;
}

.word-item.selected {
    border-color: #eee;
    background-color: #fcfcfc;
}

.word-item.selected span {
    color: #bdc3c7;
    text-decoration: line-through;
    opacity: 0.6;
}

.word-item span {
    flex-grow: 1;
    padding: 5px 0;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    padding: 0;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.btn-delete:hover {
    background-color: #c0392b;
}

.admin-header {
    margin-bottom: 20px;
}

.admin-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.nav-group {
    display: flex;
    gap: 10px;
}

.btn-secondary-link {
    background-color: #95a5a6;
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: inline-flex;
    align-items: center;
}

.btn-secondary-link:hover {
    background-color: #7f8c8d;
}

.logout-link {
    text-decoration: none;
    color: #e74c3c;
    font-weight: bold;
}

.admin-entry-container {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.entry-group {
    flex: 1;
    display: flex;
    gap: 10px;
}

.entry-group input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.entry-group button {
    padding: 8px 15px;
    background-color: #2ecc71;
    min-height: auto;
    font-size: 14px;
}

.entry-group-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-random {
    background-color: #2ecc71;
    padding: 6px 12px;
    font-size: 12px;
    min-height: auto;
    align-self: flex-start;
}

.btn-random:hover {
    background-color: #27ae60;
}

.summary-container {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    margin-top: 10px;
}

.summary-item {
    display: flex;
    align-items: center;
}

.count-badge {
    display: inline-block;
    min-width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border: 3px solid #2ecc71;
    border-radius: 12px;
    font-weight: bold;
    color: #2ecc71;
    font-size: 1.5em;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.admin-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    text-align: center;
}

.btn-primary {
    background-color: #2ecc71;
    padding: 15px 30px;
    font-weight: bold;
    min-width: 200px;
}

.btn-primary:hover {
    background-color: #27ae60;
}

.btn-primary:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    border-color: #95a5a6;
}

.btn-primary:disabled:hover {
    background-color: #bdc3c7;
}

#publish-status {
    height: 24px;
    margin-bottom: 10px;
    font-weight: bold;
}

.btn-secondary {
    background-color: #95a5a6;
    padding: 8px 15px;
    font-size: 14px;
}

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

.btn-danger {
    background-color: #e74c3c;
    width: 100%;
}

.btn-danger: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);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

.help-text {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

#settings-status {
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 10px;
        width: auto;
    }
    
    .list-container {
        gap: 10px;
    }

    .admin-entry-container {
        gap: 10px;
    }

    .admin-header h1 {
        font-size: 1.2em;
    }

    .word-item span {
        font-size: 14px;
    }
}
