Quizify / frontend /src /App.css
hetsheta's picture
fix: resolve mobile file upload click issues by making native input overlay capture taps directly
7aa7fb2
Raw
History Blame Contribute Delete
19.5 kB
/* ── LAYOUT ── */
.app {
max-width: 1360px;
margin: 0 auto;
padding: 0 2rem 5rem;
}
/* ── HERO ── */
.hero {
text-align: center;
padding: 3.5rem 1rem 2.5rem;
position: relative;
overflow: hidden;
}
.hero::before {
content: '';
position: absolute;
top: -80px; left: 50%;
transform: translateX(-50%);
width: 600px; height: 300px;
background: radial-gradient(ellipse at center, rgba(99,102,241,.22) 0%, transparent 70%);
filter: blur(40px);
pointer-events: none;
}
.hero-logo {
font-family: 'Space Grotesk', sans-serif;
font-size: clamp(2.5rem, 5vw, 3.6rem);
font-weight: 700;
background: linear-gradient(135deg, #a78bfa 0%, #818cf8 40%, #c4b5fd 80%, #e0d7ff 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
letter-spacing: -.03em;
line-height: 1;
animation: fadeSlideDown .7s ease both;
}
.hero-sub {
font-size: .82rem;
font-weight: 500;
color: var(--text-3);
letter-spacing: .22em;
text-transform: uppercase;
margin-top: .6rem;
animation: fadeSlideDown .9s ease both;
}
.hero-line {
height: 1px;
background: linear-gradient(to right, transparent, #7c3aed, #818cf8, transparent);
margin: 1.6rem auto 0;
animation: expandLine 1s ease both;
}
/* ── GRID ── */
.main-grid {
display: grid;
grid-template-columns: 340px 1fr;
gap: 1.75rem;
align-items: start;
margin-top: 2rem;
}
@media (max-width: 860px) {
.main-grid { grid-template-columns: 1fr; }
}
/* ── GLASS PANEL ── */
.glass-panel {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 18px;
padding: 1.75rem;
margin-bottom: 1.25rem;
backdrop-filter: blur(12px);
position: relative;
overflow: hidden;
animation: fadeIn .5s ease both;
transition: border-color .3s, box-shadow .3s;
}
.glass-panel::before {
content: '';
position: absolute;
inset: 0;
border-radius: 18px;
background: linear-gradient(135deg, rgba(139,92,246,.06) 0%, transparent 60%);
pointer-events: none;
}
.glass-panel:hover {
border-color: var(--border-h);
box-shadow: 0 8px 40px rgba(99,102,241,.1);
}
/* ── STEP HEADER ── */
.step-header {
display: flex;
align-items: center;
gap: .875rem;
margin-bottom: 1.4rem;
}
.step-badge {
width: 32px; height: 32px;
border-radius: 50%;
background: linear-gradient(135deg, rgba(99,102,241,.3), rgba(139,92,246,.2));
border: 1px solid rgba(139,92,246,.45);
display: flex;
align-items: center;
justify-content: center;
font-family: 'JetBrains Mono', monospace;
font-size: .65rem;
color: var(--violet-l);
flex-shrink: 0;
animation: pulse-glow 3s ease-in-out infinite;
}
.step-title {
font-family: 'Space Grotesk', sans-serif;
font-size: 1.2rem;
font-weight: 600;
color: #ede9fe;
letter-spacing: -.01em;
}
/* ── STATUS CHIP ── */
.status-chip {
display: inline-flex;
align-items: center;
gap: .45rem;
padding: .3rem .9rem;
border-radius: 100px;
font-size: .72rem;
font-weight: 700;
letter-spacing: .08em;
text-transform: uppercase;
margin: .75rem 0 .25rem;
}
.chip-ready {
background: rgba(52,211,153,.12);
border: 1px solid rgba(52,211,153,.3);
color: var(--green-l);
}
.chip-dot {
width: 6px; height: 6px;
border-radius: 50%;
background: var(--green);
animation: dot-pulse 2s ease-in-out infinite;
}
/* ── FILE DROP ZONE ── */
.drop-zone {
border: 1.5px dashed rgba(139,92,246,.3);
border-radius: 14px;
background: rgba(99,102,241,.04);
padding: 2rem 1rem;
text-align: center;
cursor: pointer;
transition: border-color .3s, background .3s, box-shadow .3s;
position: relative;
overflow: hidden;
}
.drop-zone:hover,
.drop-zone.dragging {
border-color: rgba(139,92,246,.6);
background: rgba(99,102,241,.09);
box-shadow: 0 0 24px rgba(99,102,241,.12);
}
.drop-zone input[type="file"] {
position: absolute;
inset: 0;
opacity: 0;
cursor: pointer;
width: 100%;
height: 100%;
z-index: 2;
}
.drop-icon {
font-size: 2rem;
margin-bottom: .75rem;
opacity: .5;
}
.drop-title {
font-size: .88rem;
font-weight: 600;
color: var(--text-3);
margin-bottom: .3rem;
}
.drop-sub {
font-size: .72rem;
color: var(--text-4);
letter-spacing: .08em;
text-transform: uppercase;
}
.file-chosen {
display: flex;
align-items: center;
gap: .75rem;
background: rgba(139,92,246,.08);
border: 1px solid rgba(139,92,246,.25);
border-radius: 10px;
padding: .65rem 1rem;
margin-top: .75rem;
}
.file-chosen-icon { font-size: 1.2rem; }
.file-chosen-name {
font-size: .85rem;
color: var(--violet-l);
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
}
.file-chosen-size { font-size: .72rem; color: var(--text-3); white-space: nowrap; }
/* ── FORM CONTROLS ── */
.form-group { margin-bottom: 1rem; }
.form-label {
display: block;
font-size: .7rem;
font-weight: 700;
color: var(--text-3);
text-transform: uppercase;
letter-spacing: .12em;
margin-bottom: .45rem;
}
.form-input,
.form-select {
width: 100%;
background: rgba(255,255,255,.04);
border: 1px solid rgba(139,92,246,.22);
border-radius: 10px;
color: var(--text);
font-family: 'Inter', sans-serif;
font-size: .9rem;
padding: .6rem .9rem;
outline: none;
transition: border-color .25s, box-shadow .25s;
appearance: none;
-webkit-appearance: none;
}
.form-input:focus,
.form-select:focus {
border-color: rgba(139,92,246,.55);
box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-select {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236d6a8a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right .85rem center;
padding-right: 2.2rem;
cursor: pointer;
}
.form-select option { background: #1a1730; }
.form-number-wrap { position: relative; }
.form-number-wrap input[type="number"] {
padding-right: 2.5rem;
-moz-appearance: textfield;
}
.form-number-wrap input[type="number"]::-webkit-inner-spin-button,
.form-number-wrap input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.num-btns {
position: absolute;
right: 0; top: 0; bottom: 0;
display: flex;
flex-direction: column;
border-left: 1px solid rgba(139,92,246,.18);
}
.num-btn {
flex: 1;
background: transparent;
border: none;
color: var(--text-3);
cursor: pointer;
font-size: .6rem;
padding: 0 .55rem;
transition: color .2s, background .2s;
line-height: 1;
}
.num-btn:hover { color: var(--violet-l); background: rgba(139,92,246,.1); }
.num-btn:first-child { border-bottom: 1px solid rgba(139,92,246,.18); border-radius: 0 8px 0 0; }
.num-btn:last-child { border-radius: 0 0 8px 0; }
/* ── BUTTONS ── */
.btn {
display: flex;
align-items: center;
justify-content: center;
gap: .5rem;
width: 100%;
font-family: 'Inter', sans-serif;
font-size: .87rem;
font-weight: 600;
letter-spacing: .04em;
border-radius: 10px;
border: 1px solid rgba(139,92,246,.4);
background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(139,92,246,.12));
color: var(--violet-ll);
padding: .7rem 1.5rem;
cursor: pointer;
transition: transform .22s, box-shadow .22s, background .22s, border-color .22s, color .22s;
position: relative;
overflow: hidden;
}
.btn:hover:not(:disabled) {
border-color: rgba(139,92,246,.7);
background: linear-gradient(135deg, rgba(99,102,241,.28), rgba(139,92,246,.22));
color: #ede9fe;
transform: translateY(-2px);
box-shadow: 0 6px 24px rgba(99,102,241,.22);
}
.btn:active:not(:disabled) {
transform: translateY(0);
box-shadow: 0 2px 8px rgba(99,102,241,.15);
}
.btn:disabled {
opacity: .45;
cursor: not-allowed;
}
.btn-ghost {
background: transparent;
border-color: rgba(139,92,246,.2);
color: var(--text-3);
font-size: .82rem;
}
.btn-ghost:hover:not(:disabled) {
background: rgba(139,92,246,.08);
border-color: rgba(139,92,246,.4);
color: var(--text-2);
box-shadow: none;
}
.btn-danger {
border-color: rgba(239,68,68,.3);
background: rgba(239,68,68,.08);
color: #fca5a5;
}
.btn-danger:hover:not(:disabled) {
border-color: rgba(239,68,68,.6);
background: rgba(239,68,68,.15);
color: #fee2e2;
box-shadow: 0 6px 24px rgba(239,68,68,.15);
}
/* spinner inside btn */
.btn-spinner {
width: 14px; height: 14px;
border: 2px solid rgba(196,181,253,.3);
border-top-color: #c4b5fd;
border-radius: 50%;
animation: spin .7s linear infinite;
}
/* ── DIVIDER ── */
.divider {
border: none;
border-top: 1px solid rgba(139,92,246,.1);
margin: 1rem 0;
}
/* ── QUESTION CARD ── */
.q-card {
background: rgba(255,255,255,.025);
border: 1px solid rgba(139,92,246,.14);
border-radius: 14px;
padding: 1.4rem 1.6rem;
margin-bottom: 1.1rem;
position: relative;
overflow: hidden;
transition: border-color .25s, box-shadow .25s;
animation: fadeIn .4s ease both;
}
.q-card::after {
content: '';
position: absolute;
top: 0; left: 0; right: 0;
height: 1px;
background: linear-gradient(to right, transparent, rgba(139,92,246,.3), transparent);
}
.q-card:hover {
border-color: rgba(139,92,246,.3);
box-shadow: 0 4px 24px rgba(99,102,241,.08);
}
.q-index {
font-family: 'JetBrains Mono', monospace;
font-size: .63rem;
color: #7c3aed;
letter-spacing: .18em;
text-transform: uppercase;
margin-bottom: .4rem;
}
.q-text {
font-family: 'Space Grotesk', sans-serif;
font-size: 1rem;
font-weight: 500;
color: #ede9fe;
line-height: 1.65;
margin-bottom: 1rem;
}
/* ── RADIO OPTIONS ── */
.radio-group { display: flex; flex-direction: column; gap: .45rem; }
.radio-option {
display: flex;
align-items: center;
gap: .75rem;
padding: .6rem .85rem;
border-radius: 9px;
border: 1px solid transparent;
cursor: pointer;
transition: background .2s, border-color .2s;
}
.radio-option:hover { background: rgba(139,92,246,.08); border-color: rgba(139,92,246,.25); }
.radio-option.selected {
background: rgba(99,102,241,.12);
border-color: rgba(99,102,241,.4);
}
.radio-circle {
width: 17px; height: 17px;
border-radius: 50%;
border: 2px solid rgba(139,92,246,.4);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: border-color .2s;
}
.radio-option.selected .radio-circle { border-color: var(--indigo); }
.radio-dot {
width: 8px; height: 8px;
border-radius: 50%;
background: var(--indigo);
transform: scale(0);
transition: transform .2s;
}
.radio-option.selected .radio-dot { transform: scale(1); }
.radio-label {
font-size: .9rem;
color: var(--text-2);
transition: color .2s;
}
.radio-option.selected .radio-label { color: var(--text); }
/* ── ALERTS ── */
.alert {
display: flex;
align-items: flex-start;
gap: .65rem;
padding: .8rem 1rem;
border-radius: 10px;
font-size: .86rem;
line-height: 1.5;
margin-bottom: 1rem;
border-left: 3px solid;
animation: fadeIn .3s ease both;
}
.alert-warning {
background: rgba(245,158,11,.08);
border-color: var(--amber);
color: #fcd34d;
}
.alert-error {
background: rgba(239,68,68,.08);
border-color: var(--red);
color: var(--red-l);
}
.alert-success {
background: rgba(52,211,153,.08);
border-color: var(--green);
color: var(--green-l);
}
/* ── SCORE HERO ── */
.score-wrap {
text-align: center;
padding: 2.5rem 1rem 2rem;
position: relative;
}
.score-wrap::before {
content: '';
position: absolute;
top: 0; left: 50%;
transform: translateX(-50%);
width: 400px; height: 200px;
background: radial-gradient(ellipse at center, rgba(99,102,241,.2) 0%, transparent 70%);
filter: blur(30px);
pointer-events: none;
}
.score-num {
font-family: 'Space Grotesk', sans-serif;
font-size: clamp(4rem, 10vw, 6rem);
font-weight: 700;
background: linear-gradient(135deg, #a78bfa 0%, #818cf8 50%, #e0d7ff 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
line-height: 1;
animation: fadeSlideDown .6s ease both;
}
.score-denom {
font-size: .4em;
color: var(--text-4);
-webkit-text-fill-color: var(--text-4);
}
.score-label-text {
font-size: .78rem;
font-weight: 700;
color: var(--text-4);
text-transform: uppercase;
letter-spacing: .2em;
margin-top: .4rem;
}
.score-bar-bg {
background: rgba(255,255,255,.06);
border-radius: 100px;
height: 6px;
margin: 1.5rem auto;
max-width: 320px;
overflow: hidden;
}
.score-bar-fill {
height: 100%;
border-radius: 100px;
background: linear-gradient(to right, #7c3aed, #6366f1, #a78bfa);
width: 0%;
transition: width 1.2s cubic-bezier(.4,0,.2,1);
}
.score-msg {
font-family: 'Space Grotesk', sans-serif;
font-size: 1.05rem;
font-weight: 500;
color: var(--text-3);
font-style: italic;
}
/* ── RESULT CARDS ── */
.r-card {
border-radius: 14px;
padding: 1.25rem 1.5rem;
margin-bottom: 1rem;
border: 1px solid;
position: relative;
overflow: hidden;
animation: fadeIn .4s ease both;
}
.r-correct {
background: rgba(52,211,153,.05);
border-color: rgba(52,211,153,.22);
}
.r-incorrect {
background: rgba(239,68,68,.05);
border-color: rgba(239,68,68,.22);
}
.r-badge {
display: inline-flex;
align-items: center;
gap: .35rem;
font-size: .68rem;
font-weight: 700;
letter-spacing: .12em;
text-transform: uppercase;
padding: .18rem .65rem;
border-radius: 100px;
margin-bottom: .65rem;
}
.badge-ok { background: rgba(52,211,153,.12); color: var(--green-l); border: 1px solid rgba(52,211,153,.3); }
.badge-no { background: rgba(239,68,68,.12); color: var(--red-l); border: 1px solid rgba(239,68,68,.3); }
.r-question {
font-family: 'Space Grotesk', sans-serif;
font-size: .96rem;
font-weight: 500;
color: #ede9fe;
line-height: 1.6;
margin-bottom: .7rem;
}
.answer-grid {
display: flex;
gap: 2rem;
flex-wrap: wrap;
margin-bottom: .6rem;
}
.a-label {
font-size: .65rem;
font-weight: 700;
color: var(--text-4);
text-transform: uppercase;
letter-spacing: .14em;
margin-bottom: .2rem;
}
.a-val-wrong { font-family: 'JetBrains Mono', monospace; font-size: .87rem; color: var(--red-l); }
.a-val-right { font-family: 'JetBrains Mono', monospace; font-size: .87rem; color: var(--violet-l); }
.concept-pill {
display: inline-block;
font-size: .66rem;
font-weight: 600;
color: var(--text-3);
border: 1px solid rgba(139,92,246,.2);
border-radius: 100px;
padding: .14rem .6rem;
margin-top: .45rem;
letter-spacing: .08em;
}
.expl-box {
background: rgba(99,102,241,.07);
border-left: 2px solid rgba(99,102,241,.4);
border-radius: 0 10px 10px 0;
padding: .7rem 1rem;
margin-top: .7rem;
}
.expl-label { font-size: .65rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .15em; margin-bottom: .28rem; }
.expl-text { font-size: .86rem; color: var(--text-2); line-height: 1.7; font-style: italic; }
/* ── EMPTY STATE ── */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 420px;
text-align: center;
animation: fadeIn .6s ease both;
}
.empty-icon { font-size: 3.2rem; margin-bottom: 1.2rem; opacity: .18; filter: grayscale(1); }
.empty-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 500; color: var(--text-4); font-style: italic; margin-bottom: .45rem; }
.empty-sub { font-size: .74rem; font-weight: 600; color: #2d2b40; text-transform: uppercase; letter-spacing: .12em; }
/* ── LOADING OVERLAY ── */
.loading-spinner {
width: 36px; height: 36px;
border: 3px solid rgba(139,92,246,.2);
border-top-color: var(--violet-l);
border-radius: 50%;
animation: spin .8s linear infinite;
margin: 0 auto 1rem;
}
.loading-text {
font-size: .88rem;
color: var(--text-3);
text-align: center;
font-style: italic;
}
/* ── TEXT ANSWER ── */
.text-answer {
width: 100%;
background: rgba(255,255,255,.04);
border: 1px solid rgba(139,92,246,.22);
border-radius: 10px;
color: var(--text);
font-family: 'Inter', sans-serif;
font-size: .9rem;
padding: .6rem .9rem;
outline: none;
resize: vertical;
min-height: 70px;
transition: border-color .25s, box-shadow .25s;
}
.text-answer:focus {
border-color: rgba(139,92,246,.55);
box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.text-answer::placeholder { color: var(--text-4); }
/* ── PROGRESS BAR (quiz progress) ── */
.quiz-progress-wrap { margin-bottom: 1.25rem; }
.quiz-progress-label {
display: flex;
justify-content: space-between;
font-size: .7rem;
font-weight: 600;
color: var(--text-3);
text-transform: uppercase;
letter-spacing: .1em;
margin-bottom: .45rem;
}
.quiz-progress-bar-bg {
background: rgba(255,255,255,.06);
border-radius: 100px;
height: 4px;
overflow: hidden;
}
.quiz-progress-bar-fill {
height: 100%;
border-radius: 100px;
background: linear-gradient(to right, #7c3aed, #6366f1, #a78bfa);
transition: width .5s ease;
}
/* ── SPACER ── */
.spacer { height: 1rem; }
.spacer-sm { height: .5rem; }
.spacer-lg { height: 2rem; }
/* ── RESPONSIVENESS & MEDIA QUERIES ── */
/* Tablets and below (max-width: 1024px) */
@media (max-width: 1024px) {
.app {
padding: 0 1.5rem 4rem;
}
.main-grid {
gap: 1.25rem;
margin-top: 1.5rem;
}
.glass-panel {
padding: 1.5rem;
}
}
/* Small tablets / landscape phones (max-width: 860px) */
@media (max-width: 860px) {
.app {
padding: 0 1.25rem 3.5rem;
}
.hero {
padding: 2.5rem 1rem 1.75rem;
}
.hero-logo {
font-size: clamp(2rem, 6vw, 3rem);
}
.main-grid {
grid-template-columns: 1fr;
gap: 1.25rem;
}
.glass-panel {
padding: 1.25rem;
margin-bottom: 1rem;
}
.q-card {
padding: 1.2rem 1.35rem;
}
.r-card {
padding: 1.1rem 1.35rem;
}
.answer-grid {
gap: 1.25rem;
}
}
/* Phones (max-width: 480px) */
@media (max-width: 480px) {
html, body {
overflow-x: hidden;
}
.app {
padding: 0 0.75rem 2.5rem;
overflow-x: hidden;
max-width: 100%;
}
.hero {
padding: 2rem 0.25rem 1.25rem;
}
.hero-logo {
font-size: 2.2rem;
}
.hero-sub {
font-size: 0.68rem;
letter-spacing: 0.12em;
padding: 0 0.5rem;
}
.glass-panel {
padding: 1rem;
border-radius: 14px;
}
.step-header {
margin-bottom: 1rem;
}
.step-title {
font-size: 1.1rem;
}
.step-badge {
width: 28px;
height: 28px;
font-size: 0.6rem;
}
.drop-zone {
padding: 1.5rem 0.75rem;
}
.drop-icon {
font-size: 1.6rem;
margin-bottom: 0.5rem;
}
.drop-title {
font-size: 0.82rem;
}
.drop-sub {
font-size: 0.68rem;
}
.q-card {
padding: 1rem;
border-radius: 12px;
}
.r-card {
padding: 1rem;
border-radius: 12px;
}
.q-text {
font-size: 0.95rem;
line-height: 1.55;
}
.radio-option {
padding: 0.55rem 0.75rem;
gap: 0.65rem;
}
.radio-label {
font-size: 0.86rem;
}
.answer-grid {
flex-direction: column;
gap: 0.85rem;
}
.score-num {
font-size: 4.5rem;
}
.score-msg {
font-size: 0.95rem;
}
.btn {
padding: 0.65rem 1.25rem;
font-size: 0.84rem;
}
.empty-state {
min-height: 280px;
}
}