/* ==============================================
   RESPONSIVE COMPONENTS
   Mobile-optimized UI components
   ============================================== */

/* Login Form - Mobile Optimized */
.login-container {
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 20px;
    margin: 0 auto var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.login-title {
    font-size: var(--font-size-xxl);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* Dashboard Cards Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: var(--card-shadow);
    text-align: center;
}

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

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: var(--spacing-xs);
}

/* Course Cards */
.course-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.course-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--primary);
}

.course-code {
    font-size: var(--font-size-xs);
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
}

.course-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: var(--spacing-xs) 0;
}

.course-stats {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* Search Bar - Mobile */
.search-container {
    margin-bottom: var(--spacing-md);
}

.search-input {
    width: 100%;
    height: var(--touch-target);
    padding: 0 var(--spacing-md) 0 40px;
    border: 2px solid var(--light);
    border-radius: 22px;
    font-size: var(--font-size-md);
    background: var(--white) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2395A5A6"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>') no-repeat 12px center;
    background-size: 20px;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: var(--spacing-sm);
    overflow-x: auto;
    padding: var(--spacing-sm) 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--light);
    border-radius: 16px;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.chip.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Pull to Refresh Indicator */
.pull-indicator {
    text-align: center;
    padding: var(--spacing-md);
    color: var(--gray);
    font-size: var(--font-size-sm);
    display: none;
}

.pull-indicator.visible {
    display: block;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--spacing-lg));
    right: var(--spacing-lg);
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: var(--primary);
    color: var(--white);
    border: none;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    font-size: 24px;
    transition: transform 0.2s;
}

.fab:active {
    transform: scale(0.9);
}

/* Swipe Actions */
.swipe-container {
    position: relative;
    overflow: hidden;
}

.swipe-actions {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    transform: translateX(100%);
    transition: transform 0.3s;
}

.swipe-container.swiped .swipe-actions {
    transform: translateX(0);
}

.swipe-action {
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.swipe-action.edit {
    background: var(--primary);
}

.swipe-action.delete {
    background: var(--danger);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.3;
}

.empty-text {
    color: var(--text-secondary);
    font-size: var(--font-size-md);
    margin-bottom: var(--spacing-md);
}

/* Responsive iframes (for video content) */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Accessibility - Focus visible */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .app-header,
    .mobile-nav,
    .fab {
        display: none;
    }
    
    .app-main {
        padding-bottom: 0;
    }
}
