@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* --- MOBILE APP UX ENHANCEMENTS --- */
* {
    -webkit-tap-highlight-color: transparent;
    /* Mobilde tıklama efektini kaldır */
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f8faff 0%, #e8f0fe 100%);
    min-height: 100vh;
    position: relative;
    overscroll-behavior-y: none;
    /* Sayfa sonu yaylanmasını engelle (Pull-to-refresh gibi) */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ---------------------------------- */

/* Animated Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(26, 35, 126, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(46, 204, 113, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #1a237e;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0d1b3e;
}

/* ============================================
   PREMIUM ANIMATIONS & EFFECTS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-pop-in {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.4s ease-out forwards;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.animate-pulse-slow {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(46, 204, 113, 0.3);
    }

    50% {
        box-shadow: 0 0 30px rgba(46, 204, 113, 0.6);
    }
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes scaleIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid;
}

.toast.success {
    border-left-color: #2ecc71;
}

.toast.error {
    border-left-color: #e74c3c;
}

.toast.warning {
    border-left-color: #f39c12;
}

.toast.info {
    border-left-color: #3498db;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: #1a237e;
}

.toast-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #333;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #2ecc71;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 300px;
}

.loading-text {
    margin-top: 20px;
    font-weight: 600;
    color: #1a237e;
    font-size: 16px;
}

/* Custom Modal/Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-dialog {
    transform: scale(1);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a237e;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 24px;
    color: #666;
    line-height: 1.6;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Form Validation Styles */
.form-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-error-icon {
    font-size: 16px;
}

.input-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.input-success {
    border-color: #2ecc71 !important;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1) !important;
}

/* Confetti Animation */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #ffd300;
    top: -10px;
    z-index: 9999;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti-colors-1 {
    background-color: #2ecc71;
}

.confetti-colors-2 {
    background-color: #3498db;
}

.confetti-colors-3 {
    background-color: #e74c3c;
}

.confetti-colors-4 {
    background-color: #f1c40f;
}

/* ============================================
   PREMIUM BUTTON & OPTION STYLES
   ============================================ */

.option-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.option-btn:hover:not(:disabled)::before {
    left: 100%;
}

.option-btn:hover:not(:disabled) {
    border-color: #1a237e;
    transform: translateX(6px) translateY(-2px) scale(1.02);
    box-shadow: 0 8px 16px -4px rgba(26, 35, 126, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
}

.option-btn:active:not(:disabled) {
    transform: translateX(4px) scale(0.98);
}

.option-btn.correct {
    border-color: #2ecc71 !important;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
    color: #065f46;
    animation: scaleIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.option-btn.wrong {
    border-color: #e74c3c !important;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
    color: #991b1b;
    animation: shake 0.5s ease-out;
    opacity: 0.9;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

/* ============================================
   PREMIUM SIDEBAR & NAVIGATION
   ============================================ */

.nav-btn {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, #2ecc71, #1a237e);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.nav-btn:hover::before {
    transform: scaleY(1);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.nav-btn.active {
    background: linear-gradient(135deg, #1a237e 0%, #0d1b3e 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(26, 35, 126, 0.4);
    transform: translateX(4px);
}

.nav-btn.active::before {
    transform: scaleY(1);
    width: 4px;
    background: #2ecc71;
}

.nav-btn.active svg {
    color: #2ecc71;
    filter: drop-shadow(0 0 4px rgba(46, 204, 113, 0.5));
}

/* 3D Flip Card */
.perspective-1000 {
    perspective: 1000px;
}

.transform-style-3d {
    transform-style: preserve-3d;
}

.backface-hidden {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.rotate-y-180 {
    transform: rotateY(180deg);
}

/* Mobile Sidebar */
.sidebar-open {
    transform: translateX(0) !important;
}

@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        position: fixed;
        height: 100%;
        top: 0;
        left: 0;
        bottom: 0;
    }
}

/* ============================================
   PREMIUM CARDS & GLASSMORPHISM
   ============================================ */

.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
}

.stat-card:hover::after {
    opacity: 1;
}

.dashboard-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(26, 35, 126, 0.1), transparent);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.level-card {
    background: linear-gradient(135deg, #0d1b3e 0%, #1a237e 100%);
    position: relative;
    overflow: hidden;
}

.level-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(46, 204, 113, 0.2), transparent);
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
}

/* Progress Bar Animation */
.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* ============================================
   PREMIUM SCROLLBAR
   ============================================ */

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1a237e, #0d1b3e);
    border-radius: 10px;
    transition: background 0.3s;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2ecc71, #1a237e);
}

/* ============================================
   LOADING SKELETON
   ============================================ */

@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}
/* Achievement Badges */
.badge-locked {
    filter: grayscale(1) opacity(0.3);
    transition: all 0.5s ease;
}

.badge-unlocked {
    filter: grayscale(0) opacity(1);
    transform: scale(1.1);
    animation: badge-glow 2s infinite alternate;
}

@keyframes badge-glow {
    from {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.2);
    }
    to {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    }
}

.achievement-card {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.achievement-card:hover {
    transform: translateY(-5px);
}
