/* Japanese Learning Site - Anime Style CSS */
/* Color Palette inspired by Japanese aesthetics */

:root {
    --primary-color: #FF6B9D;
    --secondary-color: #C44569;
    --accent-color: #FFA07A;
    --purple: #9B59B6;
    --blue: #667eea;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --white: #ffffff;
    --gray: #95a5a6;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.2);
    --gradient-primary: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
    --gradient-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #FFA07A 0%, #FF6B9D 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    background: linear-gradient(to bottom, #ffeef8 0%, #fff5f7 50%, #ffffff 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Auth Pages */
.auth-page {
    background: var(--gradient-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 2;
}

.auth-card {
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

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

.auth-header {
    background: var(--gradient-primary);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.logo .japanese-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.logo .site-subtitle {
    font-size: 14px;
    opacity: 0.9;
    letter-spacing: 1px;
}

.auth-body {
    padding: 40px 30px;
}

.auth-title {
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.auth-subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 14px;
}

.auth-form {
    margin-bottom: 25px;
}

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

.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.label-icon {
    margin-right: 8px;
    font-size: 18px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e8ecef;
    border-radius: 15px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.1);
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: none;
    border-radius: 15px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    font-size: 18px;
}

.alert {
    padding: 15px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.alert-icon {
    font-size: 20px;
}

.alert-error {
    background: #ffe5e5;
    color: #c33;
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: #e5ffe5;
    color: #2d7;
    border-left: 4px solid var(--success);
}

.alert-warning {
    background: #fff5e5;
    color: #d97706;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #e5f0ff;
    color: #2563eb;
    border-left: 4px solid var(--blue);
}

.auth-links {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e8ecef;
}

.auth-links p {
    color: var(--text-light);
    font-size: 14px;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.auth-links a:hover {
    color: var(--secondary-color);
}

/* Floating Decoration Elements */
.auth-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.floating-element {
    position: absolute;
    font-size: 40px;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

.element-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.element-2 {
    top: 20%;
    right: 15%;
    animation-delay: 1s;
}

.element-3 {
    bottom: 20%;
    left: 15%;
    animation-delay: 2s;
}

.element-4 {
    bottom: 15%;
    right: 10%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

/* Main Layout */
.navbar {
    background: white;
    box-shadow: 0 2px 20px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dark);
}

.navbar-brand .brand-icon {
    font-size: 32px;
}

.navbar-brand .brand-text {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    align-items: center;
}

.navbar-menu li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 14px;
}

.navbar-menu li a:hover,
.navbar-menu li a.active {
    background: var(--gradient-primary);
    color: white;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f8f9fa;
    padding: 5px 8px;
    border-radius: 20px;
}

.lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 18px;
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s;
    opacity: 0.5;
}

.lang-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.lang-btn.active {
    opacity: 1;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.notification-btn {
    position: relative;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 22px;
    border-radius: 50%;
    transition: background 0.3s;
}

.notification-btn:hover {
    background: #f8f9fa;
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
}

.user-menu:hover {
    background: #e9ecef;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}

/* Main Content */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-light);
}

.card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px var(--shadow);
    padding: 25px;
    margin-bottom: 25px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    font-size: 15px;
    line-height: 1.8;
}

/* Grid System */
.grid {
    display: grid;
    gap: 25px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Badge */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

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

.badge-secondary {
    background: var(--gradient-secondary);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-info {
    background: var(--blue);
    color: white;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
}

.table thead {
    background: var(--gradient-primary);
    color: white;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
}

.table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 25px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-container {
        padding: 0 15px;
    }

    .navbar-menu {
        display: none;
    }

    .container {
        padding: 15px;
    }

    .page-title {
        font-size: 28px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

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

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.d-flex {
    display: flex;
}

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

.justify-between {
    justify-content: space-between;
}

.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-3 { gap: 30px; }

/* ==================== DARK MODE ==================== */
body.dark-mode {
    background: linear-gradient(to bottom, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    color: #e0e0e0;
}

.dark-mode .card {
    background: #1e1e2f;
    border-color: #2d2d44;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.dark-mode .card-header {
    border-bottom-color: #2d2d44;
}

.dark-mode .card-title {
    color: #f0f0f0;
}

.dark-mode .navbar {
    background: rgba(20, 20, 35, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.dark-mode .navbar-menu a {
    color: #b0b0b0;
}

.dark-mode .navbar-menu a:hover {
    color: #FF6B9D;
}

.dark-mode .form-control {
    background: #2a2a3d;
    border-color: #3d3d5c;
    color: #e0e0e0;
}

.dark-mode .form-control:focus {
    background: #2a2a3d;
    border-color: var(--primary-color);
}

.dark-mode .table {
    background: #1e1e2f;
}

.dark-mode .table th {
    background: #252538;
    color: #e0e0e0;
}

.dark-mode .table td {
    border-color: #2d2d44;
    color: #c0c0c0;
}

.dark-mode .table tr:hover {
    background: #252538;
}

.dark-mode .page-title {
    color: #f0f0f0;
}

.dark-mode .page-subtitle {
    color: #888;
}

.dark-mode .text-light,
.dark-mode p,
.dark-mode span {
    color: #b0b0b0;
}

.dark-mode h1, .dark-mode h2, .dark-mode h3, .dark-mode h4 {
    color: #f0f0f0;
}

.dark-mode .blog-card {
    background: #1e1e2f;
}

.dark-mode .blog-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.dark-mode .alert-success {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
    color: #2ecc71;
}

.dark-mode .alert-error {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    color: #e74c3c;
}

.dark-mode .modal-content {
    background: #1e1e2f;
}

.dark-mode .modal-header {
    border-bottom-color: #2d2d44;
}

.dark-mode .modal-footer {
    border-top-color: #2d2d44;
}

.dark-mode .btn-outline {
    border-color: #4d4d6d;
    color: #b0b0b0;
}

.dark-mode .btn-outline:hover {
    background: #2a2a3d;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.dark-mode .quiz-card {
    background: #1e1e2f;
}

.dark-mode .flashcard {
    background: #1e1e2f;
}

.dark-mode .flashcard-back {
    background: #252538;
}

.dark-mode .dropdown-menu {
    background: #1e1e2f;
    border-color: #2d2d44;
}

.dark-mode .dropdown-item:hover {
    background: #252538;
}

.dark-mode .notification-item {
    border-bottom-color: #2d2d44;
}

.dark-mode .blog-actions {
    background: #252538;
}

.dark-mode .blog-content {
    color: #c0c0c0;
}

.dark-mode select.form-control option {
    background: #1e1e2f;
    color: #e0e0e0;
}

.dark-mode .user-avatar {
    background: var(--gradient-secondary);
}

.dark-mode .badge-secondary {
    background: #3d3d5c;
}

.dark-mode .vocab-popup {
    background: #1e1e2f;
}

.dark-mode .vocab-popup-body {
    background: #1e1e2f;
}

.dark-mode .vocab-popup-row {
    border-bottom-color: #2d2d44;
}

.dark-mode .vocab-popup-label {
    color: #888;
}

.dark-mode .vocab-popup-value {
    color: #e0e0e0;
}

.dark-mode .vocab-popup-footer {
    background: #252538;
}

