﻿body {
    font-family: 'Poppins', sans-serif;
    text-align: center;
    background: radial-gradient(circle at top left, #f7e8ff, #e0f7ff 28%, #ffffff 100%);
    color: #32274f;
    margin: 0;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#loginPage, #mainPage {
    max-width: 1200px;
    margin: auto;
    text-align: center;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid rgba(124, 77, 255, 0.18);
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(112, 68, 255, 0.14);
    padding: 40px 35px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

#loginPage {
    max-width: 450px;
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.login-btn {
    padding: 14px 24px;
    font-size: 1.05rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.admin-btn {
    background: linear-gradient(135deg, #7c4dff 0%, #b57bff 100%);
    color: white;
}

.admin-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(124, 77, 255, 0.3);
}

.user-btn {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.user-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(6, 182, 212, 0.3);
}

#adminLoginForm, #userLoginForm {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#adminLoginForm h3, #userLoginForm h3 {
    margin: 0 0 12px;
    color: #5d3ac7;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
}

.btn-back {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(107, 114, 128, 0.3);
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.2rem;
    color: #5d3ac7;
    margin: 0 0 24px;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.search-container {
    position: relative;
    width: 220px;
    margin: 12px auto 24px;
}

.search-container input {
    width: 100%;
    padding: 8px 14px;
    border-radius: 16px;
    border: 2px solid #8b5cf6;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(124, 77, 255, 0.1);
}

.search-container input:focus {
    border-color: #7c4dff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: white;
}

.search-container input::placeholder {
    color: #aaa;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #5d3ac7;
    margin: 0 0 18px;
}

.subtitle {
    margin: 12px auto 32px;
    max-width: 760px;
    color: #5d4a7f;
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 500;
}

.category-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.category-select {
    padding: 12px 20px;
    border-radius: 14px;
    border: 2px solid #8b5cf6;
    background: #fff;
    color: #381b7d;
    font-size: 1rem;
    outline: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.3s ease;
}

.category-select:hover {
    border-color: #7c4dff;
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.15);
}

.controls {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    color: #5d4a7f;
    font-size: 1rem;
}

.controls label {
    font-weight: 700;
}

.controls select {
    padding: 10px 14px;
    border-radius: 14px;
    border: 2px solid #8b5cf6;
    background: #fff;
    color: #381b7d;
    font-size: 0.95rem;
    outline: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
}

button {
    padding: 10px 18px;
    font-size: 0.95rem;
    color: white;
    background: linear-gradient(135deg, #7c4dff 0%, #b57bff 100%);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(124, 77, 255, 0.16);
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 35px rgba(124, 77, 255, 0.25);
    opacity: 0.95;
}

button:active {
    transform: translateY(-1px);
}

button + button {
    margin-left: 8px;
}

button.record-btn,
button.edit-btn,
button.delete-btn,
button.play-recording-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 20px;
    margin: 4px 2px;
}

button.edit-btn {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

button.delete-btn {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
}

button.play-recording-btn {
    background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
}

button.play-recording-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button.record-btn.recording {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

button.add-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    padding: 14px 18px;
    font-size: 1.4rem;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
    transition: all 0.3s ease;
}

button.add-btn:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 12px 30px rgba(34, 197, 94, 0.4);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    background: #fff;
    border: 3px solid #7c4dff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(124, 77, 255, 0.12);
}

th, td {
    padding: 18px 16px;
    text-align: center;
}

th {
    background: linear-gradient(135deg, #7c4dff 0%, #b57bff 100%);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    font-family: 'Poppins', sans-serif;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:nth-child(odd) {
    background: rgba(124, 77, 255, 0.05);
}

tbody tr:hover {
    background: rgba(124, 77, 255, 0.12);
    transform: translateX(4px);
}

td {
    border-bottom: 1px solid rgba(124, 77, 255, 0.15);
    color: #3c2c57;
    font-size: 0.95rem;
}

.english-text {
    font-weight: 700;
    color: #5d3ac7;
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.symbol-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 6px 8px;
    margin: 2px;
    transition: all 0.2s ease;
    box-shadow: none;
    display: inline-block;
}

.symbol-btn:hover {
    transform: scale(1.2) !important;
    filter: brightness(1.2);
}

.edit-symbol {
    color: #34d399;
}

.delete-symbol {
    color: #ef4444;
}

.play-symbol {
    color: #a855f7;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px 12px;
    margin: 0 4px;
    transition: all 0.2s ease;
    box-shadow: none;
    display: inline-block;
}

.play-symbol:hover {
    transform: scale(1.15);
    filter: brightness(1.2);
}

.play-symbol:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.tiny-symbol {
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 2px 4px;
    margin: 0 2px;
    transition: all 0.2s ease;
    box-shadow: none;
    display: inline-block;
}

.tiny-symbol:hover {
    transform: scale(1.25);
    filter: brightness(1.2);
}

.edit-tiny {
    color: #34d399;
}

.delete-tiny {
    color: #ef4444;
}

.delete-tiny:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

input {
    padding: 14px 16px;
    border-radius: 16px;
    border: 2px solid #dcd4ff;
    width: 260px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

#error {
    height: 1.5rem;
    margin-top: 10px;
    color: #b00020;
    font-weight: 600;
}

/* Modal Styles - Anime Popup */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f3f0ff 100%);
    margin: 10% auto;
    padding: 40px 35px;
    border: 2px solid #7c4dff;
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(124, 77, 255, 0.3);
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #7c4dff;
    cursor: pointer;
    background: none;
    border: none;
    box-shadow: none;
    transition: all 0.2s ease;
    padding: 0;
    width: auto;
    height: auto;
}

.close-btn:hover {
    color: #5d3ac7;
    transform: scale(1.2);
}

#modalTitle {
    margin-top: 0;
    margin-bottom: 24px;
}

.modal-body {
    margin-bottom: 28px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #5d3ac7;
    font-weight: 700;
    font-size: 0.95rem;
}

.input-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border-radius: 14px;
    border: 2px solid #e0d7ff;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.btn-cancel, .btn-confirm {
    flex: 1;
    padding: 12px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    color: #555;
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #d0d0d0 0%, #c0c0c0 100%);
    transform: translateY(-2px);
}

.btn-confirm {
    background: linear-gradient(135deg, #7c4dff 0%, #a855f7 100%);
    color: white;
    box-shadow: 0 10px 24px rgba(124, 77, 255, 0.2);
}

.btn-confirm:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 35px rgba(124, 77, 255, 0.3);
}

.btn-confirm:active {
    transform: translateY(-1px);
}

/* Modal show animation */
.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Menu item improvemnts */ 
.menu-item{
    transition:all 0.3s ease;
    position: relative; 
}
/* Hover animation */
.menu-item:hover{
    transform: translate(6px);
    background:#2d3b55; /* adjust to your theme */
}
/* Active state */
.menu-item.active{
    background: #3b82f6;
    transform: translate(6px);
    background: #3b82f6;
}
/* Selection Page */
#selectionPage {
    max-width: 600px;
    margin: auto;
    text-align: center;
    background: rgba(255,255,255,0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.selection-box {
    margin-bottom: 25px;
}

.selection-box h2 {
    margin-bottom: 10px;
    color: #5d3ac7;
}

.selection-box button {
    margin: 8px;
}
