/* ChemPractice Styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

.font-inter {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Unit Cards */
.unit-card {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

.unit-card:hover {
    border-color: #93c5fd;
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.unit-icon {
    height: 4rem;
    width: 4rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.unit-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.unit-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Practice Type Cards */
.practice-card {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.practice-card:hover {
    border-color: #93c5fd;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Practice card proficiency states */
.practice-card.proficiency-untried {
    border-style: dashed;
    border-color: #cbd5e1; /* slate-300 */
}

.practice-card.proficiency-weak {
    border-color: var(--error-color);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.practice-card.proficiency-improving {
    border-color: var(--warning-color);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.12);
}

.practice-card.proficiency-good {
    border-color: #eab308; /* yellow-500 */
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.12);
}

.practice-card.proficiency-mastered {
    border-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}

.practice-card-proficiency-footer {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    gap: 0.5rem;
}

.proficiency-dots {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.proficiency-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background-color: #e5e7eb; /* gray-200 */
}

.proficiency-dot.correct {
    background-color: #22c55e; /* green-500 */
}

.proficiency-dot.incorrect {
    background-color: #ef4444; /* red-500 */
}

.proficiency-dot.partial {
    background: linear-gradient(90deg, #22c55e 0%, #22c55e 50%, #e5e7eb 50%, #e5e7eb 100%);
}

.proficiency-dot.empty {
    opacity: 0.4;
}

.proficiency-details-button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
}

.proficiency-details-button i {
    font-size: 0.7rem;
}

.proficiency-details-button:hover {
    background-color: #f9fafb;
}

.practice-card-icon {
    height: 3rem;
    width: 3rem;
    border-radius: var(--radius-md);
    background: linear-gradient(to bottom right, #3b82f6, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.practice-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.practice-card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

/* Practice Screen */
.practice-container {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    padding: 2rem;
    margin-bottom: 2rem;
}

.question-container {
    background-color: #f9fafb;
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 2px solid var(--border);
}

.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.answer-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.response-container {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.response-correct {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.response-incorrect {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.response-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.answer-display {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: white;
    z-index: 1;
    font-family: 'Courier New', monospace;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    box-sizing: border-box;
}

#ionicAnswerWrapper,
#covalentAnswerWrapper {
    position: relative;
    width: 100%;
}

#ionicAnswerWrapper input[style*="opacity: 0"],
#covalentAnswerWrapper input[style*="opacity: 0"] {
    background-color: transparent !important;
}

/* Options Section */
.options-section {
    background-color: #f9fafb;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.options-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
}

.checkbox-item input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    cursor: pointer;
}

.checkbox-item label {
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
}

select.answer-input {
    cursor: pointer;
    background-color: white;
    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='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

select.answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Coefficient selectors - hide dropdown arrow */
select.answer-input.coefficient-select,
select[id*="Coeff"] {
    background-image: none !important;
    padding-right: 4px !important;
    cursor: pointer;
}

select.answer-input.coefficient-select:focus,
select[id*="Coeff"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Hide spinner arrows on number inputs for coefficients */
input[type="number"].coefficient-select::-webkit-outer-spin-button,
input[type="number"].coefficient-select::-webkit-inner-spin-button,
input[type="number"][id*="Coeff"]::-webkit-outer-spin-button,
input[type="number"][id*="Coeff"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"].coefficient-select,
input[type="number"][id*="Coeff"] {
    -moz-appearance: textfield;
}

input[type="number"].coefficient-select:focus,
input[type="number"][id*="Coeff"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
}

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

.btn-secondary:hover {
    background-color: #475569;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary:disabled,
.btn-primary[disabled] {
    background-color: #9ca3af; /* gray-400 */
}

.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
    background-color: #9ca3af;
}

.btn-secondary:disabled,
.btn-secondary[disabled] {
    background-color: #cbd5e1; /* slate-300 */
    color: #1f2937; /* gray-800 */
}

.btn-secondary:disabled:hover,
.btn-secondary[disabled]:hover {
    background-color: #cbd5e1;
}

.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Stats Display */
.stats-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: var(--radius-md);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Coming Soon Modal */
.coming-soon-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-center;
    z-index: 50;
}

.coming-soon-content {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.coming-soon-icon {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.coming-soon-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.coming-soon-message {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Isotope Table Styling */
table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.875rem;
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
}

table thead th {
    background-color: #f3f4f6;
    font-weight: 600;
    color: var(--text-primary);
}

table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

table tbody tr:hover {
    background-color: #f3f4f6;
}

/* Lewis Diagram Styles */
.lewis-diagram-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 2rem auto;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background-color: white;
}

.electron-slot-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.electron-slot {
    position: relative;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.electron-slot-outline {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 2px dashed #e2e8f0;
    border-radius: 50%;
    background-color: transparent;
    transition: all 0.2s;
}

.electron-slot:hover .electron-slot-outline {
    border-color: var(--primary-color);
    border-style: solid;
    background-color: rgba(37, 99, 235, 0.05);
    transform: scale(1.1);
}

.electron-slot .electron-dot.filled {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--text-primary);
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Pipette Practice Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 16px rgba(34, 197, 94, 0.9));
    }
}

#pipetteWorkspace {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#pipetteWorkspace svg {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Pipette Practice 2.0: disable selection */
#pipette2Workspace {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#pipette2Workspace svg {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.draggable-item {
    transition: filter 0.2s ease;
}

.draggable-item:hover {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.can-attach {
    animation: glow 1s ease-in-out infinite;
}

/* Keyboard key styling */
kbd {
    display: inline-block;
    padding: 3px 6px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1;
    color: #1f2937;
    background-color: #e5e7eb;
    border: 1px solid #9ca3af;
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

/* Pipette measurement marks */
.pipette-mark-minor {
    opacity: 0.3;
}

.pipette-mark-major {
    opacity: 1;
}

/* Key labels on SVG elements */
.key-label {
    user-select: none;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 640px) {
    .unit-card {
        min-height: 160px;
        padding: 1.5rem;
    }
    
    .practice-card {
        min-height: 150px;
        padding: 1rem;
    }
    
    .stats-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
    
    .lewis-diagram-container {
        width: 320px;
        height: 320px;
    }
    
    #lewisSymbolBox {
        width: 160px !important;
        height: 160px !important;
        font-size: 6rem !important;
    }
    
    #lewisSymbolInput {
        font-size: 6rem !important;
    }
    
    .electron-slot {
        width: 28px;
        height: 28px;
    }
    
    .electron-slot-outline {
        width: 24px;
        height: 24px;
    }
    
    .electron-dot.filled {
        width: 16px;
        height: 16px;
    }
}

/* Bohr-Rutherford Diagram Styles */
.bohr-diagram-container {
    position: relative;
    width: 100%;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem auto;
    background: radial-gradient(circle at center, #f8fafc 0%, #ffffff 100%);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    overflow: visible;
}

.bohr-svg {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    position: relative;
    z-index: 1;
}

.orbital-circle {
    /* No hover effects - just static circles */
    pointer-events: none !important; /* Prevent focusing on orbital circles */
}

/* Shell labels - absolutely non-interactive */
.shell-label,
text[class*="shell"] {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
}

.electron-slot-group {
    /* Electron groups should be on top and clickable */
    pointer-events: all !important;
    cursor: pointer;
    z-index: 1000;
}

.electron-click-area {
    /* Click area should be highest priority */
    pointer-events: all !important;
    cursor: pointer;
    z-index: 1001;
}

.electron-slot-outline {
    transition: stroke-color 0.15s ease;
}

.electron-dot {
    /* No animations - electrons sit still */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.electron-dot[data-filled="true"] {
    /* No pulse animation - static electrons */
}

.nucleus-glow {
    /* Keep subtle glow but no animation */
    opacity: 0.5;
}

.bohr-nucleus-input {
    outline: none;
    font-family: inherit;
    color: var(--text-primary);
}

/* Hide spinner arrows on Bohr nucleus inputs */
.bohr-nucleus-input::-webkit-outer-spin-button,
.bohr-nucleus-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bohr-nucleus-input {
    -moz-appearance: textfield;
}

.bohr-nucleus-input:focus {
    color: var(--primary-color);
    font-weight: 700;
}

.bohr-nucleus-input:disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .bohr-diagram-container {
        min-height: 400px;
        padding: 1rem;
    }
    
    .bohr-svg {
        transform: scale(0.7);
        transform-origin: center;
    }
}

/* Periodic Table Styles */
.periodic-table-container {
    display: inline-block;
    font-size: 0.75rem;
    margin: 0 auto;
    text-align: center;
}

.periodic-table-wrapper {
    display: inline-block;
}

/* F-block: lanthanides and actinides — visual link to insertion point in main table */
.pt-f-insert {
    visibility: visible;
    border: 1px dashed rgba(100, 116, 139, 0.35);
    border-radius: 4px;
    background: rgba(241, 245, 249, 0.6);
    border-bottom-color: rgba(100, 116, 139, 0.5);
}

.pt-f-block {
    margin-left: 0;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(100, 116, 139, 0.35);
    border-left: 1px solid rgba(100, 116, 139, 0.25);
    border-right: 1px solid rgba(100, 116, 139, 0.25);
    border-bottom: 1px solid rgba(100, 116, 139, 0.25);
    border-radius: 0 0 6px 6px;
    background: rgba(248, 250, 252, 0.4);
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.pt-element {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 50px;
    margin: 2px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: white;
    vertical-align: top;
}

.pt-element:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.pt-element.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pt-element-number {
    font-size: 0.6rem;
    position: absolute;
    top: 2px;
    left: 3px;
    font-weight: 600;
}

.pt-element-symbol {
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 12px;
    display: block;
}

.pt-element-value {
    font-size: 0.6rem;
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    font-weight: 500;
}

.pt-ionic-multivalent {
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    font-size: 0.5rem;
    line-height: 1.15;
    text-align: center;
}
.pt-ionic-line {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pt-ionic-charge {
    font-weight: 600;
    margin-right: 2px;
}
.pt-ionic-name {
    font-size: 0.45rem;
    opacity: 0.9;
}

.pt-empty {
    display: inline-block;
    width: 50px;
    height: 50px;
    margin: 2px;
    visibility: hidden;
}

.pt-row {
    white-space: nowrap;
    margin-bottom: 0;
}

.pt-element-details {
    background-color: white;
    padding: 1rem;
    border-radius: var(--radius-md);
}

.pt-element-details h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.pt-element-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.pt-element-details-item {
    padding: 0.5rem;
    background-color: #f9fafb;
    border-radius: var(--radius-sm);
}

.pt-element-details-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.pt-element-details-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 0.25rem;
}
