/* ============================================
   Mektebia - Duolingo Tarzı Özel Stiller
   ============================================ */

/* === CSS Değişkenleri === */
:root {
    --duo-green: #58CC02;
    --duo-green-dark: #46A302;
    --duo-green-light: #89E219;
    --duo-blue: #1CB0F6;
    --duo-blue-dark: #1899D6;
    --duo-red: #FF4B4B;
    --duo-red-dark: #EA2B2B;
    --duo-orange: #FF9600;
    --duo-orange-dark: #E08600;
    --duo-purple: #CE82FF;
    --duo-purple-dark: #B065E0;
    --duo-yellow: #FFC800;
    --duo-yellow-dark: #E0B000;
    --duo-teal: #00C9A7;
    --duo-snow: #F7F7F7;
    --duo-white: #FFFFFF;
    --duo-swan: #E5E5E5;
    --duo-hare: #AFAFAF;
    --duo-wolf: #777777;
    --duo-eel: #4B4B4B;
    --duo-night: #1A1A2E;
    --duo-sidebar: #FFFFFF;
    --duo-radius: 16px;
    --duo-radius-sm: 12px;
    --duo-radius-xs: 8px;
    --duo-shadow: 0 4px 0;
    --duo-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Google Font: Nunito === */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

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

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--duo-snow);
    color: var(--duo-eel);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* === Animasyonlar === */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

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

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.animate-slideDown { animation: slideDown 0.4s ease-out; }
.animate-slideUp { animation: slideUp 0.4s ease-out; }
.animate-fadeIn { animation: fadeIn 0.5s ease-out; }
.animate-scaleIn { animation: scaleIn 0.3s ease-out; }
.animate-bounceIn { animation: bounceIn 0.6s ease-out; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* === Duo Butonlar (Soft Press Efekti) === */
.duo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--duo-radius);
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--duo-transition);
    text-decoration: none;
    user-select: none;
    position: relative;
}

.duo-btn:active {
    transform: translateY(4px);
}

/* Green */
.duo-btn-green {
    background-color: var(--duo-green);
    color: white;
    box-shadow: var(--duo-shadow) var(--duo-green-dark);
}
.duo-btn-green:hover { background-color: #4DBF00; }
.duo-btn-green:active { box-shadow: none; }

/* Blue */
.duo-btn-blue {
    background-color: var(--duo-blue);
    color: white;
    box-shadow: var(--duo-shadow) var(--duo-blue-dark);
}
.duo-btn-blue:hover { background-color: #10A4EA; }
.duo-btn-blue:active { box-shadow: none; }

/* Red */
.duo-btn-red {
    background-color: var(--duo-red);
    color: white;
    box-shadow: var(--duo-shadow) var(--duo-red-dark);
}
.duo-btn-red:hover { background-color: #EE3333; }
.duo-btn-red:active { box-shadow: none; }

/* Orange */
.duo-btn-orange {
    background-color: var(--duo-orange);
    color: white;
    box-shadow: var(--duo-shadow) var(--duo-orange-dark);
}
.duo-btn-orange:hover { background-color: #F08C00; }
.duo-btn-orange:active { box-shadow: none; }

/* Ghost / Outline */
.duo-btn-ghost {
    background-color: transparent;
    color: var(--duo-blue);
    border: 2px solid var(--duo-swan);
    box-shadow: var(--duo-shadow) var(--duo-swan);
}
.duo-btn-ghost:hover { background-color: #F0F0F0; border-color: var(--duo-blue); }
.duo-btn-ghost:active { box-shadow: none; }

.duo-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--duo-radius-sm);
}

.duo-btn-sm:active {
    transform: translateY(3px);
}

/* === Duo Kartlar === */
.duo-card {
    background: var(--duo-white);
    border: 2px solid var(--duo-swan);
    border-radius: var(--duo-radius);
    padding: 24px;
    transition: var(--duo-transition);
}

.duo-card:hover {
    border-color: var(--duo-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.duo-card-stat {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.duo-card-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--duo-radius) var(--duo-radius) 0 0;
}

.duo-card-stat.green::before { background: var(--duo-green); }
.duo-card-stat.blue::before { background: var(--duo-blue); }
.duo-card-stat.orange::before { background: var(--duo-orange); }
.duo-card-stat.purple::before { background: var(--duo-purple); }

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    margin: 12px 0 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--duo-wolf);
    font-weight: 700;
}

/* === Duo Input === */
.duo-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--duo-swan);
    border-radius: var(--duo-radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--duo-eel);
    background: var(--duo-white);
    transition: var(--duo-transition);
    outline: none;
}

.duo-input:focus {
    border-color: var(--duo-blue);
    box-shadow: 0 0 0 3px rgba(28, 176, 246, 0.15);
}

.duo-input::placeholder {
    color: var(--duo-hare);
    font-weight: 600;
}

.duo-textarea {
    min-height: 120px;
    resize: vertical;
}

.duo-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23777' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.duo-label {
    display: block;
    font-weight: 800;
    font-size: 14px;
    color: var(--duo-eel);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Admin Layout === */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--duo-white);
    border-right: 2px solid var(--duo-swan);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 32px 20px;
    border-bottom: 2px solid var(--duo-swan);
    display: flex;
    justify-content: center;
    align-items: center;
}

.duo-brand {
    font-size: 2.2rem;
    font-weight: 900;
    color: #000000;
    text-decoration: none;
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: -1px;
    padding: 10px 0;
}

.sidebar-logo h1 {
    font-size: 2.2rem;
    font-weight: 900;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.sidebar-nav {
    padding: 16px 12px;
}

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--duo-hare);
    padding: 8px 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--duo-radius-sm);
    color: var(--duo-eel);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: var(--duo-transition);
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background-color: var(--duo-snow);
    color: var(--duo-blue);
}

.sidebar-link.active {
    background-color: #DDF4FF;
    color: var(--duo-blue);
}

.sidebar-link .icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-link .badge {
    margin-left: auto;
    background: var(--duo-blue);
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 50px;
}

/* Main Content */
.admin-main {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
}

.admin-topbar {
    background: var(--duo-white);
    border-bottom: 2px solid var(--duo-swan);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}

.admin-topbar h2 {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--duo-eel);
}

.admin-content {
    padding: 32px;
}

/* === Duo Tablo === */
.duo-table-wrapper {
    overflow-x: auto;
    border: 2px solid var(--duo-swan);
    border-radius: var(--duo-radius);
    background: var(--duo-white);
}

.duo-table {
    width: 100%;
    border-collapse: collapse;
}

.duo-table thead {
    background: var(--duo-snow);
}

.duo-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--duo-wolf);
    border-bottom: 2px solid var(--duo-swan);
}

.duo-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #F0F0F0;
    font-weight: 600;
    font-size: 14px;
}

.duo-table tbody tr {
    transition: var(--duo-transition);
}

.duo-table tbody tr:hover {
    background-color: #FAFBFF;
}

.duo-table tbody tr:last-child td {
    border-bottom: none;
}

/* === Duo Badge === */
.duo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.duo-badge-green { background: #E5F9D0; color: #3A8A00; }
.duo-badge-blue { background: #DDF4FF; color: #0A7AC9; }
.duo-badge-red { background: #FFE0E0; color: #CC2222; }
.duo-badge-orange { background: #FFF3E0; color: #CC7700; }
.duo-badge-purple { background: #F3E8FF; color: #8B3DC9; }
.duo-badge-gray { background: #F0F0F0; color: #666; }

/* === Form Grid === */
.form-grid {
    display: grid;
    gap: 20px;
}

.form-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.form-grid-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.form-group {
    margin-bottom: 0;
}

/* === Correct Answer Radio === */
.answer-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.answer-option {
    position: relative;
}

.answer-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.answer-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 3px solid var(--duo-swan);
    border-radius: var(--duo-radius-sm);
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: var(--duo-transition);
    background: var(--duo-white);
}

.answer-option input[type="radio"]:checked + label {
    border-color: var(--duo-green);
    background: #E5F9D0;
    color: var(--duo-green-dark);
    box-shadow: 0 3px 0 var(--duo-green-dark);
}

.answer-option label:hover {
    border-color: var(--duo-blue);
    background: #F0F9FF;
}

/* === Image Upload === */
.image-upload-area {
    border: 3px dashed var(--duo-swan);
    border-radius: var(--duo-radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--duo-transition);
    position: relative;
    overflow: hidden;
}

.image-upload-area:hover {
    border-color: var(--duo-blue);
    background: #FAFBFF;
}

.image-upload-area.has-image {
    padding: 16px;
    border-style: solid;
    border-color: var(--duo-green);
}

.image-upload-area .upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.image-upload-area .upload-text {
    font-weight: 700;
    color: var(--duo-wolf);
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--duo-radius-xs);
    object-fit: contain;
}

/* === Login Page === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #58CC02 0%, #1CB0F6 50%, #CE82FF 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    top: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

.login-container::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    bottom: -80px;
    left: -80px;
    animation: float 8s ease-in-out infinite reverse;
}

.login-card {
    background: var(--duo-white);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: scaleIn 0.5s ease-out;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--duo-green);
    margin-top: 16px;
    letter-spacing: -1px;
}

.login-logo p {
    color: var(--duo-wolf);
    font-weight: 600;
    margin-top: 4px;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--duo-eel);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--duo-wolf);
    font-weight: 600;
    margin-bottom: 24px;
}

/* === Pagination === */
.duo-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.duo-pagination a,
.duo-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--duo-radius-sm);
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    transition: var(--duo-transition);
    border: 2px solid var(--duo-swan);
    color: var(--duo-eel);
}

.duo-pagination a:hover {
    border-color: var(--duo-blue);
    color: var(--duo-blue);
    background: #F0F9FF;
}

.duo-pagination .active {
    background: var(--duo-blue);
    color: white;
    border-color: var(--duo-blue);
}

/* === Modal / Delete Confirm === */
.duo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease-out;
    display: none;
}

.duo-modal-overlay.active {
    display: flex;
}

.duo-modal {
    background: var(--duo-white);
    border-radius: 24px;
    padding: 32px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.3s ease-out;
}

.duo-modal h3 {
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 12px;
}

.duo-modal p {
    color: var(--duo-wolf);
    font-weight: 600;
    margin-bottom: 24px;
}

/* === Difficulty Badge === */
.difficulty-easy { background: #E5F9D0; color: #3A8A00; }
.difficulty-medium { background: #FFF3E0; color: #CC7700; }
.difficulty-hard { background: #FFE0E0; color: #CC2222; }

/* === Mobile Sidebar Toggle === */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    color: var(--duo-eel);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 35;
}

/* === Tooltip === */
.duo-tooltip {
    position: relative;
}

.duo-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--duo-eel);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 8px;
}

.duo-tooltip:hover::after {
    opacity: 1;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .form-grid-4 {
        grid-template-columns: 1fr 1fr;
    }
    .answer-options {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .admin-content {
        padding: 20px 16px;
    }
    
    .admin-topbar {
        padding: 12px 16px;
    }
    
    .form-grid-2,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .answer-options {
        grid-template-columns: 1fr 1fr;
    }
    
    .login-card {
        padding: 32px 24px;
    }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--duo-snow);
}

::-webkit-scrollbar-thumb {
    background: var(--duo-swan);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--duo-hare);
}

/* === Selection === */
::selection {
    background: var(--duo-blue);
    color: white;
}

/* === Loading Skeleton === */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--duo-radius-xs);
}

/* === Lottie containers === */
.lottie-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

dotlottie-wc,
lottie-player {
    display: block;
}

/* === SweetAlert2 Duolingo Style === */
.swal2-popup.duo-swal-popup {
    border-radius: 32px !important;
    border: 3px solid var(--duo-swan) !important;
    box-shadow: 0 10px 0 var(--duo-swan) !important;
    padding: 2.5rem !important;
    font-family: 'Nunito', sans-serif !important;
}
.swal2-title.duo-swal-title {
    font-weight: 900 !important;
    color: var(--duo-eel) !important;
    font-size: 1.6rem !important;
    margin-bottom: 12px !important;
}
.swal2-html-container.duo-swal-content {
    font-weight: 800 !important;
    color: var(--duo-wolf) !important;
    font-size: 1.15rem !important;
    line-height: 1.5 !important;
}
.swal2-icon.swal2-info {
    border-color: var(--duo-blue) !important;
    color: var(--duo-blue) !important;
}

/* === Ders Ekle Butonu Özelleştirme === */
.duo-btn-add-schedule {
    background: #f0f0f0 !important;
    color: #4b4b4b !important;
    border: 2px solid #e5e5e5 !important;
    box-shadow: 0 4px 0 #e5e5e5 !important;
    transition: all 0.2s !important;
    padding: 10px 20px !important;
    border-radius: 12px !important;
    font-weight: 900 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}

.duo-btn-add-schedule:hover {
    background: var(--duo-green) !important;
    color: white !important;
    border-color: var(--duo-green-dark) !important;
    box-shadow: 0 4px 0 var(--duo-green-dark) !important;
    transform: translateY(-2px);
}

.duo-btn-add-schedule:active {
    transform: translateY(2px);
    box-shadow: none !important;
}

