/* Study Materials Enhanced Styles */
/* Comprehensive styling for UI/UX improvements */

/* ==================== VARIABLES & ROOT STYLES ==================== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #4caf50;
    --danger-color: #f5576c;
    --warning-color: #fbc02d;
    --info-color: #00bcd4;
    --light-bg: #f5f7fa;
    --dark-bg: #1a1a1a;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
}

/* ==================== HERO SECTIONS ==================== */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.bg-gradient-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.1) 75%, transparent 75%, transparent);
    background-size: 60px 60px;
    animation: slidePattern 20s linear infinite;
    pointer-events: none;
}

@keyframes slidePattern {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 60px 60px;
    }
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.bg-gradient-tertiary {
    background: linear-gradient(135deg, #4c63d2 0%, #5a3a95 100%);
    color: white;
}

.bg-gradient-semester {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.bg-gradient-subject {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.bg-light-gradient {
    background: linear-gradient(135deg, #f5f7fa 0%, #f1f5f9 100%);
}

/* ==================== HERO ELEMENTS ==================== */
.text-white-75 {
    color: rgba(255, 255, 255, 0.75);
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.5);
}

.opacity-10 {
    opacity: 0.1;
}

.opacity-20 {
    opacity: 0.2;
}

/* ==================== BREADCRUMB ENHANCED ==================== */
.breadcrumb-nav {
    background: linear-gradient(135deg, #f9f9f9 0%, #f5f5f5 100%);
    border-bottom: 1px solid #e0e0e0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.breadcrumb-nav:hover {
    box-shadow: var(--shadow-md);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    position: relative;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
}

.breadcrumb-item a:hover {
    color: #0b5ed7;
    background: rgba(13, 110, 253, 0.1);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== SECTION HEADERS ==================== */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-bg);
    position: relative;
    padding-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.section-header {
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.section-header p {
    font-size: 1.05rem;
    margin-top: 0.5rem;
}

/* ==================== STATISTICS CARDS ==================== */
.stat-card {
    padding: 2rem 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.stat-card h3 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #6c757d;
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* ==================== STUDY CARDS ==================== */
.study-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
}

.study-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
}

.study-card.featured {
    border: 2px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.card-header-custom {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-header-custom h5 {
    margin-bottom: 0;
    font-weight: 600;
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.card-stats {
    display: flex;
    gap: 12px;
    padding: 12px;
    /*background-color: #8272cf;*/
    border-radius: 8px;
    margin-bottom: 0;
}

.stat-item {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.stat-label {
    color: #6c757d;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== FEATURE CARDS ==================== */
.feature-card {
    padding: 2rem 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-left: 4px solid transparent;
    height: 100%;
}

.feature-card:hover {
    border-left-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.feature-card .feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-card h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ==================== QUICK LINK CARDS ==================== */
.quick-link-card {
    padding: 2rem 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.quick-link-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.quick-link-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.quick-link-card h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quick-link-card .btn {
    margin-top: auto;
}

/* ==================== MATERIAL TYPE CARDS ==================== */
.material-type-card {
    padding: 2rem 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid var(--border-color);
}

.material-type-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.material-icon {
    font-size: 2.5rem;
}

.material-type-card h5 {
    font-size: 1.1rem;
    margin-bottom: 0;
    font-weight: 600;
}

/* ==================== SEARCH & NAVIGATION ==================== */
.search-form {
    max-width: 700px;
    margin: 0 auto;
}

.search-form .input-group-text {
    font-size: 1.25rem;
    background: white;
    border: none;
    color: var(--primary-color);
}

.sticky-search {
    position: sticky;
    top: 80px;
    background: white;
    box-shadow: var(--shadow-sm);
    z-index: 90;
    transition: var(--transition);
}

.sticky-search:hover {
    box-shadow: var(--shadow-md);
}

/* ==================== ALERTS & NOTICES ==================== */
.alert-icon {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
}

/* ==================== ADDITIONAL UI/UX ENHANCEMENTS ==================== */

/* Hero Section Patterns */
.bg-gradient-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Enhanced Hover Effects */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
}

/* Badge Enhancements */
.badge {
    letter-spacing: 0.5px;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
}

.badge-lg {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

/* Enhanced Buttons with Icons */
.btn i {
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

.btn:hover i {
    transform: translateX(2px);
}

.btn-icon-only {
    padding: 0.75rem;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Enhanced Forms */
.form-control, 
.form-select {
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.form-control:focus, 
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    transform: translateY(-2px);
}

/* Input Group Enhancements */
.input-group {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.15);
}

/* Pagination Enhancements */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    color: var(--primary-color);
}

.page-link:hover {
    color: white;
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Enhanced Cards */
.card-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-bottom: 2px solid var(--border-color);
}

.card-footer {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
    border-top: 1px solid var(--border-color);
}

/* Loading State */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: loading-pulse 2s infinite;
}

@keyframes loading-pulse {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Back to Top Button */
.btn-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.btn-back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Print Styles */
@media print {
    .btn,
    .navbar,
    .footer,
    .back-to-top {
        display: none !important;
    }

    .section-title {
        color: #000;
        page-break-inside: avoid;
    }

    .study-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Tab Navigation */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    gap: 0.5rem;
}

.nav-tabs .nav-link {
    color: #6c757d;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: none;
    border-bottom-color: var(--primary-color);
}

/* Breadcrumb Enhancements */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item {
    position: relative;
}

.breadcrumb-item::after {
    content: '';
}

.breadcrumb-item + .breadcrumb-item::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    margin: 0 0.5rem;
    color: #ccc;
}

/* Responsive Grid Utilities */
@media (max-width: 768px) {
    .d-none-sm {
        display: none !important;
    }

    .d-inline-sm {
        display: inline !important;
    }
}

/* Color Variants */
.bg-primary-light {
    background-color: rgba(102, 126, 234, 0.1);
}

.text-primary-dark {
    color: #5b6ad4;
}

.border-primary-light {
    border-color: rgba(102, 126, 234, 0.2);
}

/* Skeleton Loading */
.skeleton-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    height: 1rem;
}

.skeleton-circle {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

/* Toast Notifications */
.toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border: none;
}

.toast-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
}

.toast-body {
    padding: 1rem;
}

/* Badge Animations */
.badge {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(102, 126, 234, 0);
    }
}

/* Text Shadows for Better Readability */
.text-shadow-sm {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15);
}

/* RTL Support */
[dir="rtl"] .fa-arrow-right::before {
    content: "\\f053";
}

[dir="rtl"] .fa-arrow-left::before {
    content: "\\f054";
}

/* Mobile Menu Enhancement */
@media (max-width: 991px) {
    .navbar-collapse {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 12px;
        margin-top: 0.5rem;
    }

    .navbar-collapse .nav-link {
        color: rgba(255, 255, 255, 0.8);
        transition: all 0.2s ease;
    }

    .navbar-collapse .nav-link:hover {
        color: white;
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ==================== DARK MODE ==================== */
@media (prefers-color-scheme: dark) {
    .study-card {
        background: #1e1e1e;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .study-card:hover {
        border-color: rgba(102, 126, 234, 0.5);
    }

    .stat-card,
    .feature-card,
    .quick-link-card,
    .material-type-card {
        background: #1e1e1e;
        border-color: rgba(255, 255, 255, 0.1);
        color: #e0e0e0;
    }

    .card-stats {
        background-color: #2d2d2d;
    }

    .section-title {
        color: #e0e0e0;
    }

    .breadcrumb-nav {
        background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .sticky-top,
    .breadcrumb-nav .btn-group-sm,
    .quick-action-bar {
        display: none;
    }

    .section-title {
        page-break-inside: avoid;
    }

    .study-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .stat-icon,
    .floating-icon,
    .study-card,
    .animate-fade-in,
    .pulse {
        animation: none !important;
        transition: none !important;
    }
}

/* ==================== LOADING SKELETON ==================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    height: 300px;
    border-radius: var(--border-radius);
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}
