Trivia1 / assets /style.css
Bharath370's picture
Upload style.css
86f29f3 verified
/* assets/style.css */
/* Custom CSS for TriviaVerse Enhanced */
/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
/* Global Variables */
:root {
--primary-color: #4CAF50;
--secondary-color: #45a049;
--background-color: #ffffff;
--text-color: #262730;
--border-radius: 12px;
--transition: all 0.3s ease;
}
/* Dark mode variables */
[data-theme="dark"] {
--primary-color: #00D4FF;
--secondary-color: #00a8cc;
--background-color: #0E1117;
--text-color: #FAFAFA;
}
/* Global Styles */
* {
box-sizing: border-box;
}
body {
font-family: 'Poppins', sans-serif;
line-height: 1.6;
color: var(--text-color);
background-color: var(--background-color);
}
/* Smooth scrolling */
html {
scroll-behavior: smooth;
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.1);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
background: var(--primary-color);
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--secondary-color);
}
/* Animations */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slideInLeft {
from {
opacity: 0;
transform: translateX(-50px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
100% {
transform: scale(1);
}
}
@keyframes shimmer {
0% {
background-position: -200px 0;
}
100% {
background-position: calc(200px + 100%) 0;
}
}
/* Utility Classes */
.fade-in {
animation: fadeIn 0.5s ease-out forwards;
}
.slide-in-left {
animation: slideInLeft 0.5s ease-out forwards;
}
.pulse {
animation: pulse 2s ease-in-out infinite;
}
/* Loading skeleton */
.skeleton {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200px 100%;
animation: shimmer 1.5s ease-in-out infinite;
}
/* Card hover effects */
.hover-lift {
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
transform: translateY(-5px);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
/* Flashcard Component */
.flashcard-container {
perspective: 1000px;
min-height: 300px;
cursor: pointer;
}
.flashcard {
width: 100%;
min-height: 300px;
border-radius: 20px;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
color: white;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
transition: transform 0.6s;
transform-style: preserve-3d;
}
.flashcard.front {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.flashcard.back {
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.flashcard p {
font-size: 1.2rem;
}
.flip-instruction {
margin-top: 30px;
opacity: 0.8;
font-style: italic;
}
/* Responsive Typography */
h1 {
font-size: clamp(1.5rem, 4vw, 2.5rem);
font-weight: 700;
}
h2 {
font-size: clamp(1.25rem, 3vw, 2rem);
font-weight: 600;
}
h3 {
font-size: clamp(1.1rem, 2.5vw, 1.5rem);
font-weight: 600;
}
p {
font-size: clamp(0.9rem, 2vw, 1.1rem);
}
/* Mobile-first responsive design */
@media (max-width: 768px) {
/* Mobile styles */
.main .block-container {
padding: 1rem 0.5rem !important;
max-width: 100% !important;
}
/* Stack columns on mobile */
.row-widget.stHorizontal {
flex-direction: column !important;
}
.row-widget.stHorizontal>div {
width: 100% !important;
margin-bottom: 1rem;
}
/* Full-width buttons on mobile */
.stButton>button {
width: 100% !important;
min-height: 50px;
font-size: 16px !important;
}
/* Larger touch targets */
.stRadio>div>label {
padding: 15px !important;
margin: 5px 0 !important;
}
/* Responsive cards */
.card {
padding: 15px !important;
margin: 10px 0 !important;
}
/* Hide sidebar by default on mobile */
section[data-testid="stSidebar"] {
transform: translateX(-100%);
transition: transform 0.3s ease;
}
section[data-testid="stSidebar"][aria-expanded="true"] {
transform: translateX(0);
}
/* Adjust font sizes for mobile */
.score-display {
font-size: 24px !important;
}
/* Responsive quiz container */
.quiz-container {
padding: 20px !important;
margin: 15px 0 !important;
}
}
/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
.main .block-container {
max-width: 95%;
padding: 2rem 1rem;
}
.row-widget.stHorizontal>div {
flex: 1;
}
}
/* Desktop styles */
@media (min-width: 1025px) {
.main .block-container {
max-width: 1200px;
padding: 3rem 2rem;
}
}
/* Print styles */
@media print {
.stButton,
section[data-testid="stSidebar"],
.stRadio {
display: none !important;
}
.main {
padding: 0 !important;
}
.card {
break-inside: avoid;
page-break-inside: avoid;
}
}
/* Accessibility improvements */
.stButton>button:focus,
.stRadio>div>label:focus {
outline: 3px solid var(--primary-color);
outline-offset: 2px;
}
/* High contrast mode support */
@media (prefers-contrast: high) {
:root {
--primary-color: #00AA00;
--background-color: #000000;
--text-color: #FFFFFF;
}
}
/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Custom tooltip */
.tooltip {
position: relative;
display: inline-block;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 200px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -100px;
opacity: 0;
transition: opacity 0.3s;
}
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}