/* Custom Fonts */
.font-poppins {
    font-family: 'Poppins', sans-serif;
}

.japanese-font {
    font-family: 'Noto Sans JP', sans-serif;
}

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out;
}

.animate-slide-down {
    animation: slideDown 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Loading Spinner */
.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #fef3c7;
    border-top: 4px solid #b45309;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

body.dark-mode .spinner {
    border: 4px solid #334155;
    border-top: 4px solid #9333ea;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #fef3c7;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #b45309, #ea580c);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #92400e, #c2410c);
}

/* Custom Scrollbar - Dark Mode */
body.dark-mode ::-webkit-scrollbar-track {
    background: #1e293b;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #9333ea, #ec4899);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #7e22ce, #db2777);
}

/* Dark Mode Styles */
body.dark-mode {
    background: linear-gradient(to bottom right, #1e1b4b, #312e81, #1e293b);
    color: #e5e7eb;
}

body.dark-mode header {
    background: rgba(30, 27, 75, 0.8);
}

body.dark-mode .bg-white {
    background-color: rgba(30, 41, 59, 0.9);
}

body.dark-mode .text-gray-800 {
    color: #e5e7eb;
}

body.dark-mode .text-gray-700 {
    color: #d1d5db;
}

body.dark-mode .text-gray-600 {
    color: #9ca3af;
}

body.dark-mode textarea {
    background-color: rgba(51, 65, 85, 0.5);
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode textarea::placeholder {
    color: #9ca3af;
}

body.dark-mode .bg-gradient-to-r.from-purple-50 {
    background: linear-gradient(to right, rgba(147, 51, 234, 0.2), rgba(236, 72, 153, 0.2));
}

body.dark-mode .bg-gradient-to-r.from-blue-50 {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2));
}

body.dark-mode .bg-gradient-to-r.from-green-50 {
    background: linear-gradient(to right, rgba(34, 197, 94, 0.2), rgba(59, 130, 246, 0.2));
}

body.dark-mode .bg-gradient-to-r.from-yellow-50 {
    background: linear-gradient(to right, rgba(234, 179, 8, 0.2), rgba(249, 115, 22, 0.2));
}

/* Dark Mode - Coffee Theme Overrides */
body.dark-mode .bg-gradient-to-br.from-amber-50,
body.dark-mode .bg-gradient-to-br.from-yellow-50,
body.dark-mode .bg-gradient-to-br.from-orange-50 {
    background: rgba(30, 41, 59, 0.9);
}

body.dark-mode .bg-amber-50,
body.dark-mode .bg-amber-100,
body.dark-mode .bg-amber-200 {
    background-color: rgba(51, 65, 85, 0.7);
}

body.dark-mode .bg-yellow-50,
body.dark-mode .bg-yellow-100,
body.dark-mode .bg-yellow-200 {
    background-color: rgba(51, 65, 85, 0.7);
}

body.dark-mode .bg-orange-50,
body.dark-mode .bg-orange-100,
body.dark-mode .bg-orange-200 {
    background-color: rgba(51, 65, 85, 0.7);
}

body.dark-mode .text-amber-900,
body.dark-mode .text-amber-800,
body.dark-mode .text-amber-700 {
    color: #e5e7eb;
}

body.dark-mode .border-amber-200,
body.dark-mode .border-amber-300,
body.dark-mode .border-yellow-200,
body.dark-mode .border-yellow-300,
body.dark-mode .border-orange-200,
body.dark-mode .border-orange-300 {
    border-color: #4b5563;
}

body.dark-mode .hover\:bg-amber-200:hover,
body.dark-mode .hover\:bg-amber-300:hover {
    background-color: rgba(71, 85, 105, 0.8);
}

body.dark-mode .bg-gradient-to-r.from-amber-700,
body.dark-mode .bg-gradient-to-r.from-amber-600 {
    background: linear-gradient(to right, #9333ea, #ec4899);
}

body.dark-mode .bg-amber-700,
body.dark-mode .bg-amber-600 {
    background-color: #9333ea;
}

body.dark-mode .bg-orange-700,
body.dark-mode .bg-orange-600 {
    background-color: #ec4899;
}

body.dark-mode .bg-yellow-700,
body.dark-mode .bg-yellow-600 {
    background-color: #d946ef;
}

/* Dark Mode - Progress Bar Colors */
body.dark-mode .bg-amber-700 {
    background-color: #9333ea !important;
}

body.dark-mode .bg-yellow-700 {
    background-color: #3b82f6 !important;
}

body.dark-mode .bg-orange-700 {
    background-color: #ec4899 !important;
}

/* Dark Mode - Progress Card Text Colors */
body.dark-mode .text-amber-800,
body.dark-mode .text-yellow-800,
body.dark-mode .text-orange-800 {
    color: #e5e7eb !important;
}

/* Dark Mode - Progress Card Backgrounds */
body.dark-mode .bg-gradient-to-br.from-amber-100.to-yellow-100 {
    background: linear-gradient(to bottom right, rgba(147, 51, 234, 0.2), rgba(236, 72, 153, 0.2)) !important;
}

body.dark-mode .bg-gradient-to-br.from-yellow-100.to-orange-100 {
    background: linear-gradient(to bottom right, rgba(59, 130, 246, 0.2), rgba(147, 197, 253, 0.2)) !important;
}

body.dark-mode .bg-gradient-to-br.from-orange-100.to-amber-100 {
    background: linear-gradient(to bottom right, rgba(236, 72, 153, 0.2), rgba(244, 114, 182, 0.2)) !important;
}

/* Dark Mode - Progress Card Borders */
body.dark-mode .border-amber-300 {
    border-color: #4b5563 !important;
}

body.dark-mode .border-yellow-300 {
    border-color: #4b5563 !important;
}

body.dark-mode .border-orange-300 {
    border-color: #4b5563 !important;
}

/* Dark Mode - Progress Bar Track Colors */
body.dark-mode .bg-amber-200 {
    background-color: #334155 !important;
}

body.dark-mode .bg-yellow-200 {
    background-color: #334155 !important;
}

body.dark-mode .bg-orange-200 {
    background-color: #334155 !important;
}

/* Dark Mode - Mock Test Section */
body.dark-mode .bg-gradient-to-r.from-orange-100.to-red-100 {
    background: linear-gradient(to right, rgba(239, 68, 68, 0.2), rgba(248, 113, 113, 0.2)) !important;
}

body.dark-mode .border-orange-400 {
    border-color: #dc2626 !important;
}

body.dark-mode .bg-orange-600 {
    background-color: #dc2626 !important;
}

body.dark-mode .text-orange-700 {
    color: #fca5a5 !important;
}

body.dark-mode .bg-amber-50 {
    background-color: rgba(51, 65, 85, 0.5) !important;
}

body.dark-mode .border.border-amber-300 {
    border-color: #4b5563 !important;
}

/* Dark Mode - Tips Section */
body.dark-mode .bg-gradient-to-r.from-yellow-100.to-amber-100 {
    background: linear-gradient(to right, rgba(234, 179, 8, 0.2), rgba(245, 158, 11, 0.2)) !important;
}

body.dark-mode .border-l-4.border-amber-600 {
    border-color: #f59e0b !important;
}

body.dark-mode .text-amber-700 {
    color: #fbbf24 !important;
}

body.dark-mode .text-amber-900 {
    color: #e5e7eb !important;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .japanese-font {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.75rem;
    }
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

button, a {
    transition: all 0.3s ease;
}

/* Focus States */
button:focus, textarea:focus, input:focus {
    outline: none;
}

/* Hover Effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Badge Styles */
.badge-basic {
    background: linear-gradient(to right, #10b981, #34d399);
    color: white;
}

.badge-intermediate {
    background: linear-gradient(to right, #f59e0b, #fbbf24);
    color: white;
}

.badge-advanced {
    background: linear-gradient(to right, #ef4444, #f87171);
    color: white;
}

/* Modal Animation */
.modal-enter {
    animation: fadeIn 0.3s ease-out;
}

.modal-content-enter {
    animation: scaleIn 0.3s ease-out;
}

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .glass {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Text Selection */
::selection {
    background-color: #b45309;
    color: white;
}

::-moz-selection {
    background-color: #b45309;
    color: white;
}

/* Text Selection - Dark Mode */
body.dark-mode ::selection {
    background-color: #9333ea;
    color: white;
}

body.dark-mode ::-moz-selection {
    background-color: #9333ea;
    color: white;
}

/* Loading State */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Tooltip */
[title] {
    position: relative;
}

/* Nice gradient backgrounds for cards */
.gradient-card {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
}

body.dark-mode .gradient-card {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
}
