/* ============================================================
   physics/styles.css — Physics-specific overrides
   Base styles: ../shared/css/subject-base.css
   ============================================================ */

/* ---- Physics colours ---- */
:root {
    --primary: #e84393;
    --primary-light: #fce4f0;
}

/* ---- Physics topic tags ---- */
.topic-tag.mech { background: #e3f2fd; color: #1565c0; }
.topic-tag.waves { background: #f3e5f5; color: #7b1fa2; }
.topic-tag.elec { background: #fff3e0; color: #e65100; }
.topic-tag.thermal { background: #fbe9e7; color: #bf360c; }
.topic-tag.mag { background: #e8eaf6; color: #283593; }
.topic-tag.atomic { background: #e8f5e9; color: #2e7d32; }
.topic-tag.space { background: #ede7f6; color: #4527a0; }
.topic-tag.invest { background: linear-gradient(135deg, #00b894, #55efc4); color: #fff; }
.topic-tag.paper { background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: #fff; }

/* ---- Calculator button (physics colour) ---- */
.calc-btn {
    box-shadow: 0 4px 16px rgba(232,67,147,0.4);
}
.calc-btn:hover { background: #d63384; }

/* ---- Marks badge ---- */
.marks-badge {
    display: inline-block; padding: 4px 12px; border-radius: 16px;
    font-size: 0.75rem; font-weight: 700; background: #e8eaf6; color: #283593;
}
body.dark-mode .marks-badge { background: rgba(40,57,147,0.2); color: #90caf9; }

/* ---- Periodic Table floating ---- */
.pt-btn {
    position: fixed; bottom: 24px; right: 148px; z-index: 1000;
    width: 48px; height: 48px; border-radius: 50%;
    background: #5c6bc0; color: #fff; border: none;
    box-shadow: 0 4px 16px rgba(92,107,192,0.4);
    cursor: pointer; font-size: 1.4rem; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.pt-btn:hover { transform: scale(1.1); background: #3f51b5; }
.pt-btn.active { background: var(--error); }
.pt-modal {
    display: none; position: fixed; bottom: 82px; right: 24px; z-index: 1001;
    width: min(95vw, 720px); background: var(--card);
    border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    overflow: hidden; animation: slideUp 0.2s ease;
}
.pt-modal.show { display: block; }
.pt-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #5c6bc0; color: #fff; font-weight: 700; font-size: 0.9rem; }
.pt-close { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1; }
.pt-container { padding: 10px; overflow-x: auto; }
.pt-info { min-height: 36px; display: flex; align-items: center; gap: 8px; padding: 4px 8px; margin-bottom: 6px; font-size: 0.82rem; flex-wrap: wrap; }
.pt-info-hint { color: var(--text-light); font-style: italic; font-size: 0.78rem; }
.pt-info-z { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: 0.8rem; }
.pt-info-sym { font-size: 1.3rem; font-weight: 800; }
.pt-info-name { font-weight: 600; }
.pt-info-mass { color: var(--text-light); font-size: 0.8rem; }
.pt-info-cat { padding: 2px 8px; border-radius: 10px; font-size: 0.72rem; font-weight: 600; }
.pt-grid {
    display: grid; grid-template-columns: repeat(18, 1fr); grid-template-rows: repeat(10, auto);
    gap: 1px; font-size: 0.6rem;
}
.pt-cell {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 2px 1px; border-radius: 3px; cursor: pointer; min-height: 32px;
    transition: transform 0.15s, box-shadow 0.15s; border: 1px solid rgba(0,0,0,0.08);
}
.pt-cell:hover { transform: scale(1.4); z-index: 10; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.pt-marker { cursor: default; font-size: 0.55rem; opacity: 0.7; }
.pt-marker:hover { transform: none; box-shadow: none; }
.pt-z { font-size: 0.5rem; line-height: 1; opacity: 0.7; }
.pt-sym { font-size: 0.72rem; font-weight: 700; line-height: 1.2; }
.pt-cat-alkali { background: #ff6b6b; color: #fff; }
.pt-cat-alkaline { background: #ffa94d; color: #fff; }
.pt-cat-transition { background: #ffd43b; color: #333; }
.pt-cat-post-trans { background: #69db7c; color: #333; }
.pt-cat-metalloid { background: #38d9a9; color: #333; }
.pt-cat-nonmetal { background: #4dabf7; color: #fff; }
.pt-cat-halogen { background: #9775fa; color: #fff; }
.pt-cat-noble { background: #da77f2; color: #fff; }
.pt-cat-lanthanide { background: #f783ac; color: #fff; }
.pt-cat-actinide { background: #e599f7; color: #fff; }
.pt-legend { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; justify-content: center; }
.pt-legend-item { padding: 2px 8px; border-radius: 8px; font-size: 0.65rem; font-weight: 600; }
.pt-grid > .pt-cell[style*="grid-row: 9"] { margin-top: 6px; }
.pt-grid > .pt-cell[style*="grid-row: 10"] { margin-top: 1px; }
@media (max-width: 480px) {
    .pt-btn { bottom: 16px; right: 128px; width: 42px; height: 42px; font-size: 1.1rem; }
    .pt-modal { width: calc(100vw - 16px); right: 8px; bottom: 68px; }
    .pt-grid { font-size: 0.45rem; }
    .pt-cell { min-height: 24px; padding: 1px; }
    .pt-z { font-size: 0.38rem; }
    .pt-sym { font-size: 0.55rem; }
}

/* ---- Dark Mode (physics --primary-light) ---- */
body.dark-mode {
    --primary-light: rgba(232,67,147,0.15);
}

/* ---- Paper Generator: context box (physics-specific) ---- */
.pg-context-box {
    background: #f0f4ff; border-left: 4px solid #6c5ce7;
    padding: 18px 20px; border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 16px; font-size: 0.92rem; line-height: 1.6;
}
.pg-context-title { font-weight: 700; font-size: 1rem; margin-bottom: 8px; color: #6c5ce7; }
.pg-topic-label {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    background: #6c5ce7; color: #fff; font-size: 0.7rem; font-weight: 700;
    margin-right: 8px; vertical-align: middle;
}
.pg-q-topic {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    background: #6c5ce7; color: #fff; font-size: 0.68rem; font-weight: 700;
}
.pg-grade-circle {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100px; height: 100px; border-radius: 50%;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    box-shadow: 0 4px 20px rgba(108,92,231,0.3); margin-bottom: 16px;
}
.pg-nav-btn.answered { background: #e8eaf6; border-color: #7986cb; }

/* Dark mode paper gen (physics-specific) */
body.dark-mode .pg-context-box { background: rgba(108,92,231,0.1); border-left-color: #a29bfe; }
body.dark-mode .pg-context-title { color: #a29bfe; }
body.dark-mode .pg-nav-btn.active { background: rgba(232,67,147,0.15); }
body.dark-mode .pg-nav-btn.answered { background: rgba(121,134,203,0.15); border-color: #7986cb; }

/* ---- Paper Generator Working (physics-specific) ---- */
.pg-working-marked { border: 2px solid rgba(232,67,147,0.25); border-radius: 10px; padding: 12px; background: rgba(232,67,147,0.03); }
body.dark-mode .pg-working-marked { border-color: rgba(232,67,147,0.3); background: rgba(232,67,147,0.05); }

/* ---- Formula table header ---- */
.formula-table th { text-align: left; font-weight: 600; opacity: 0.7; font-size: 0.85rem; }

/* ---- TTS Reader Bar ---- */
.tts-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; padding: 8px 12px; background: var(--bg-subtle, #f5f6fa); border-radius: 10px; border: 1px solid var(--border); }
.tts-btn { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--primary); color: #fff; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.15s, opacity 0.2s; flex-shrink: 0; }
.tts-btn:hover { transform: scale(1.1); }
.tts-btn:active { transform: scale(0.95); }
.tts-speed { background: var(--primary-light, #eef0ff); color: var(--primary); font-weight: 700; font-size: 0.7rem; width: auto; padding: 0 10px; border-radius: 8px; }
.tts-voice-select { border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: 0.75rem; background: var(--card); color: var(--text); max-width: 140px; cursor: pointer; }
.tts-label { font-size: 0.78rem; color: var(--text-light); margin-left: 4px; }
body.dark-mode .tts-bar { background: rgba(255,255,255,0.06); }
.tts-word { cursor: default; border-radius: 3px; transition: background 0.2s, color 0.2s; }
.tts-word-ready { background: var(--primary-light, #eef0ff); color: var(--primary); cursor: pointer; }
body.dark-mode .tts-word-ready { background: rgba(67,97,238,0.2); }

/* ---- Loading screen (physics gradient + animations) ---- */
.loading-screen {
    background: linear-gradient(135deg, #1a0a1e 0%, #2d1b3d 40%, #1a1a2e 70%, #0f1f3d 100%);
}
.loading-arc {
    animation: arc-draw 2s ease-in-out infinite;
    transform-origin: center;
}
@keyframes arc-draw {
    0% { stroke-dashoffset: 264; }
    50% { stroke-dashoffset: 66; }
    100% { stroke-dashoffset: 264; }
}
.loading-orbit { animation: orbit-pulse 3s ease-in-out infinite; }
.loading-orbit:nth-child(4) { animation-delay: 0.5s; }
.loading-orbit:nth-child(5) { animation-delay: 1s; }
@keyframes orbit-pulse {
    0%,100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}
.loading-electron {
    animation: electron-orbit 2s linear infinite;
    transform-origin: 50px 50px;
}
@keyframes electron-orbit { to { transform: rotate(360deg); } }
.loading-bar {
    background: linear-gradient(90deg, #e84393, #6c5ce7, #0984e3);
}
