/**
 * Router-specific styles for Shakti SPA
 */

/* Route containers */
.route-content {
    width: 100%;
    min-height: 100vh;
}

/* Navigation active states */
.recap-btn.active,
.stories-btn.active {
    background-color: #2563eb;
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

/* Back buttons */
.back-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    margin-bottom: 16px;
}

.back-btn:hover {
    background: #4b5563;
}

/* Route-specific body classes for styling */
body.route-home .route-content:not(#mainContent) {
    display: none !important;
}

body.route-recap .route-content:not(#recapContent) {
    display: none !important;
}

body.route-stories .route-content:not(#storiesContent) {
    display: none !important;
}

/* Ensure main content is hidden when on other routes */
body.route-recap #mainContent,
body.route-stories #mainContent {
    display: none !important;
}

/* Recap specific styles */
#recapContent .recap-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

#recapContent .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

#recapContent .header h1 {
    margin: 0;
    color: #1f2937;
    font-size: 2rem;
}

/* Stories specific styles */
#storiesContent .stories-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

#storiesContent .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

#storiesContent .header h1 {
    margin: 0;
    color: #1f2937;
    font-size: 2rem;
}

/* Loading states */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6b7280;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error states */
.error-container {
    margin: 16px 0;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px;
    border-radius: 6px;
    margin: 16px 0;
}

.retry-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 8px;
}

.retry-btn:hover {
    background: #b91c1c;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state h2 {
    color: #374151;
    margin-bottom: 8px;
}

.start-learning-btn {
    background: #059669;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 16px;
}

.start-learning-btn:hover {
    background: #047857;
}

/* Pagination controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.nav-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.nav-btn:hover:not(:disabled) {
    background: #2563eb;
}

.nav-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.page-indicator {
    color: #6b7280;
    font-weight: 500;
}

/* Desktop responsiveness */
@media (max-width: 768px) {
    .route-content {
        padding: 12px;
    }
    
    #recapContent .header,
    #storiesContent .header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}
