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

body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Dark mode: make background truly dark */
.dark,
.dark body {
    background-color: #050505;
}

.dark .bg-white,
.dark .dark\:bg-slate-900 {
    background-color: #0b0b0b !important;
}

.dark .dark\:bg-slate-950 {
    background-color: #050505 !important;
}


main {
    flex: 1;
}

.molecule-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
}


.jsme-container {
    width: 100%;
    height: 520px;
}

@media (max-width: 1024px) {
    .jsme-container {
        height: 460px;
    }
}

@media (max-width: 640px) {
    .jsme-container {
        height: 400px;
    }
}

canvas {
    width: 100%;
    height: auto;
    max-width: 240px;
    margin: 0 auto;
}

#flashcard-canvas {
    max-width: none;
    width: 100%;
    height: 100%;
}

.pka-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 9999px;
    transition: all 0.3s ease;
}

.nav-link.active {
    border-bottom: 2px solid #3b82f6;
    color: #3b82f6;
}

.header-hidden-mobile {
    transform: translateY(-100%);
}

.smiles-input {
    flex-grow: 1;
    background: transparent;
    border: 1px solid transparent;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 9px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: text;
}

.dark .smiles-input:hover {
    background: #1e293b;
    color: #94a3b8;
}

.smiles-input:hover {
    background: #f1f5f9;
    color: #64748b;
}

.smiles-input:focus {
    outline: none;
    background: white;
    border-color: #bfdbfe;
    color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.dark .smiles-input:focus {
    background: #0f172a;
    border-color: #334155;
    color: #60a5fa;
}

.reset-btn {
    padding: 4px;
    border-radius: 4px;
    color: #94a3b8;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reset-btn:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

.dark .reset-btn:hover {
    background-color: #450a0a;
    color: #f87171;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.perspective-1000 {
    perspective: 1000px;
}
.transform-style-3d {
    transform-style: preserve-3d;
}
.backface-hidden {
    backface-visibility: hidden;
}
.rotate-y-180 {
    transform: rotateY(180deg);
}
.flipped {
    transform: rotateY(180deg);
}

@media (max-width: 640px) {
    .progress-table thead tr {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 16px;
    }

    .progress-table thead th {
        flex: 1 1 45%;
        padding: 0;
    }

    .progress-table thead th .progress-sort-btn {
        width: 100%;
        justify-content: space-between;
        padding: 6px 10px;
        border: 1px solid #e2e8f0;
        border-radius: 9999px;
        background: #ffffff;
    }

    .dark .progress-table thead th .progress-sort-btn {
        border-color: #334155;
        background: #0f172a;
    }

    .progress-table tbody tr {
        display: block;
        padding: 12px 16px;
    }

    .progress-table tbody td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 0;
    }

    .progress-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
    }

    .dark .progress-table tbody td::before {
        color: #94a3b8;
    }
}

.touch-target {
    min-height: 44px;
}

@media (max-width: 640px) {
    .touch-target {
        padding-block: 0.75rem;
        padding-inline: 1rem;
    }

    #controls-container {
        gap: 0.9rem;
    }

    #controls-container .flex {
        gap: 0.75rem;
    }

    #rating-controls {
        gap: 0.75rem;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    #rating-controls .touch-target {
        width: 100%;
    }
}

.flashcard-back-inner {
    height: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.flashcard-answer-panel {
    padding: 1rem;
    border-radius: 1.5rem;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    backdrop-filter: blur(6px);
}
.dark .flashcard-answer-panel {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}
.flashcard-image-panel {
    flex: 1;
    min-height: 220px;
    border-radius: 1.75rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(226, 232, 240, 0.5);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}
.dark .flashcard-image-panel {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(51, 65, 85, 0.8);
}
.flashcard-prompt-panel {
    padding: 1rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.1);
}
.dark .flashcard-prompt-panel {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgba(79, 70, 229, 0.6);
}

