/* =====================================================
   Berjuara - Reusable Components
   ===================================================== */

/* =====================================================
   Buttons
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: var(--text-base);
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    min-width: 0;
    max-width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.3);
}

/* Secondary Button */
.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(34, 197, 94, 0.05);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--secondary);
    border-color: var(--secondary);
}

.btn-outline-secondary:hover {
    background: var(--secondary);
    color: white;
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--text-sm);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--text-lg);
}

.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: var(--text-lg);
}

/* Full Width Button */
.btn-block {
    width: 100%;
}

/* Icon Only Button */
.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius);
}

.btn-icon.btn-sm {
    width: 36px;
    height: 36px;
}

.btn-icon.btn-lg {
    width: 52px;
    height: 52px;
}

/* =====================================================
   Cards
   ===================================================== */

.card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.card-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Card Variants */
.card-elevated {
    border: none;
    box-shadow: var(--shadow-md);
}

.card-elevated:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* =====================================================
   Forms
   ===================================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.form-label.required::after {
    content: '*';
    color: var(--error);
    margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: var(--text-base);
    font-family: inherit;
    color: var(--text-primary);
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--error);
}

.form-input.success,
.form-select.success {
    border-color: var(--success);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    margin-top: 0.5rem;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.form-error {
    margin-top: 0.5rem;
    font-size: var(--text-xs);
    color: var(--error);
}

/* Input with Icon */
.input-group {
    position: relative;
}

.input-group .form-input {
    padding-left: 3rem;
}

.input-group-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group-icon-right {
    left: auto;
    right: 1rem;
    cursor: pointer;
}

.input-group .form-input:focus + .input-group-icon {
    color: var(--primary);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.form-check-input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

/* =====================================================
   Badges
   ===================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: rgba(34, 197, 94, 0.1);
    color: var(--primary);
}

.badge-secondary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--secondary);
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge-gray {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

/* =====================================================
   Alerts
   ===================================================== */

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.alert-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-message {
    font-size: var(--text-sm);
    margin: 0;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--info);
}

/* =====================================================
   Progress Bar
   ===================================================== */

.progress {
    height: 8px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.progress-sm {
    height: 4px;
}

.progress-lg {
    height: 12px;
}

/* =====================================================
   Avatar
   ===================================================== */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--text-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
    background: white;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: var(--text-xs);
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: var(--text-lg);
}

.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: var(--text-2xl);
}

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    border: 2px solid white;
    margin-left: -10px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* =====================================================
   Tabs
   ===================================================== */

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 1rem 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.tab-content {
    padding: 1.5rem 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Pills Tabs */
.tabs-pills {
    border-bottom: none;
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 0.25rem;
}

.tabs-pills .tab {
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
}

.tabs-pills .tab.active {
    background: white;
    box-shadow: var(--shadow-sm);
}

.tabs-pills .tab.active::after {
    display: none;
}

/* =====================================================
   Modal
   ===================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--border);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Modal Sizes */
.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 700px;
}

.modal-xl {
    max-width: 900px;
}

/* =====================================================
   Dropdown
   ===================================================== */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* =====================================================
   Tooltip
   ===================================================== */

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    padding: 0.5rem 0.75rem;
    background: var(--text-primary);
    color: white;
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: 100;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* =====================================================
   Table
   ===================================================== */

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
}

.table th {
    background: var(--bg-primary);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.table td {
    border-bottom: 1px solid var(--border-light);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--bg-primary);
}

/* =====================================================
   Spinner / Loading
   ===================================================== */

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 3000;
}

.loading-text {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* =====================================================
   Empty State
   ===================================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: var(--text-lg);
    margin-bottom: 0.5rem;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* =====================================================
   Stats Card
   ===================================================== */

.stats-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.stats-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stats-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stats-card-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
}

.stats-card-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stats-card-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-xs);
    font-weight: 600;
    margin-top: 0.5rem;
}

.stats-card-change.positive {
    color: var(--success);
}

.stats-card-change.negative {
    color: var(--error);
}

/* =====================================================
   Question Card
   ===================================================== */

.question-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    color: white;
    font-weight: 700;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

.question-text {
    font-size: var(--text-lg);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.question-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.question-option:hover {
    border-color: var(--primary);
    background: rgba(34, 197, 94, 0.05);
}

.question-option.selected {
    border-color: var(--primary);
    background: rgba(34, 197, 94, 0.1);
}

.question-option.correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.question-option.incorrect {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: white;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.question-option.selected .option-letter,
.question-option.correct .option-letter {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.question-option.incorrect .option-letter {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.option-text {
    padding-top: 0.25rem;
    color: var(--text-secondary);
}

/* =====================================================
   Timer
   ===================================================== */

.timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 600;
    font-family: 'Poppins', monospace;
}

.timer-icon {
    color: var(--primary);
}

.timer.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.timer.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* =====================================================
   Sidebar Navigation
   ===================================================== */

.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-menu {
    padding: 1rem;
}

.sidebar-menu-title {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: var(--transition-fast);
    cursor: pointer;
}

.sidebar-item:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--primary);
}

.sidebar-item i {
    width: 20px;
    text-align: center;
}

.sidebar-item .badge {
    margin-left: auto;
}

/* =====================================================
   Page Header
   ===================================================== */

.page-header {
    margin-bottom: 2rem;
}

.page-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.page-title {
    font-size: var(--text-2xl);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--border);
}

/* =====================================================
   Notification / Toast
   ===================================================== */

.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 1rem;
    z-index: 2100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: white;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--error); }
.toast.info { border-left-color: var(--info); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* =====================================================
   Components Responsive Styles
   ===================================================== */

@media (max-width: 991px) {
    /* Sidebar mobile */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    /* Modal adjustments */
    .modal {
        max-width: calc(100% - 2rem);
    }

    .modal-lg,
    .modal-xl {
        max-width: calc(100% - 2rem);
    }

    /* Tabs scrollable */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Question card */
    .question-card {
        padding: 1.5rem;
    }

    /* Stats card */
    .stats-card {
        padding: 1rem;
    }

    .stats-card-value {
        font-size: var(--text-2xl);
    }
}

@media (max-width: 767px) {
    /* Buttons */
    .btn {
        padding: 0.75rem 1.25rem;
    }

    .btn-lg {
        padding: 0.875rem 1.5rem;
    }

    /* Cards */
    .card-header,
    .card-body,
    .card-footer {
        padding: 1rem;
    }

    /* Modal */
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Sidebar */
    .sidebar {
        width: 100%;
        max-width: 300px;
    }

    /* Question card */
    .question-card {
        padding: 1rem;
    }

    .question-text {
        font-size: var(--text-base);
    }

    .question-option {
        padding: 0.875rem 1rem;
    }

    /* Tabs */
    .tabs-pills {
        padding: 0.125rem;
    }

    .tabs-pills .tab {
        padding: 0.625rem 1rem;
        font-size: var(--text-sm);
    }

    /* Timer */
    .timer {
        padding: 0.5rem 0.875rem;
        font-size: var(--text-sm);
    }

    /* Toast */
    .toast-container {
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 1rem;
    }

    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }

    /* Empty state */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state-icon {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }

    /* Form */
    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.75rem;
    }

    /* Alert */
    .alert {
        padding: 0.875rem 1rem;
    }

    /* Stats card */
    .stats-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stats-card-value {
        font-size: var(--text-xl);
    }

    .stats-card-label {
        font-size: var(--text-xs);
    }

    /* Avatar */
    .avatar-xl {
        width: 64px;
        height: 64px;
        font-size: var(--text-xl);
    }

    /* Table */
    .table th,
    .table td {
        padding: 0.75rem;
        font-size: var(--text-sm);
    }

    /* Page header */
    .page-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-title {
        font-size: var(--text-xl);
    }

    .breadcrumb {
        display: none;
    }
}

@media (max-width: 479px) {
    /* Buttons compact */
    .btn {
        padding: 0.625rem 1rem;
        font-size: var(--text-sm);
        white-space: normal;
        text-align: center;
        word-break: break-word;
    }

    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: var(--text-xs);
    }

    .btn i {
        font-size: 0.75rem;
        flex-shrink: 0;
    }

    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: var(--text-sm);
    }

    /* Cards */
    .card-header,
    .card-body,
    .card-footer {
        padding: 0.75rem;
    }

    /* Modal */
    .modal {
        border-radius: var(--radius-lg);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.75rem;
    }

    .modal-title {
        font-size: var(--text-base);
    }

    /* Question */
    .question-number {
        width: 28px;
        height: 28px;
        font-size: var(--text-xs);
    }

    .question-text {
        font-size: var(--text-sm);
        line-height: 1.6;
    }

    .question-option {
        padding: 0.625rem 0.75rem;
        gap: 0.5rem;
    }

    .option-letter {
        width: 24px;
        height: 24px;
        font-size: var(--text-xs);
    }

    .option-text {
        font-size: var(--text-sm);
    }

    /* Badge */
    .badge {
        padding: 0.125rem 0.5rem;
        font-size: 0.625rem;
    }

    /* Alert */
    .alert {
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
    }

    .alert-icon {
        margin-bottom: 0.5rem;
    }

    /* Form */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-label {
        font-size: var(--text-xs);
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.625rem 0.75rem;
        font-size: var(--text-sm);
    }

    /* Stats card */
    .stats-card {
        padding: 0.75rem;
    }

    .stats-card-icon {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .stats-card-value {
        font-size: var(--text-lg);
    }

    /* Dropdown */
    .dropdown-menu {
        min-width: 160px;
    }

    .dropdown-item {
        padding: 0.5rem 0.75rem;
        font-size: var(--text-sm);
    }

    /* Progress */
    .progress {
        height: 6px;
    }

    .progress-lg {
        height: 10px;
    }

    /* Timer */
    .timer {
        padding: 0.375rem 0.75rem;
        font-size: var(--text-xs);
    }
}
