/* Study Page - Modern Professional Design */

/* Header Fix - Ensure header is not transparent on study page */
.study-page #main-header {
    background: white !important;
    background-color: white !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.study-page #main-header nav,
.study-page #main-header .header-content {
    background: transparent !important;
    background-color: white !important;
}

/* Quick Category Filter Buttons */
.category-btn {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.category-btn:hover {
    transform: translateY(-1px);
}

.category-btn.active {
    background: #7c3aed !important;
    color: white !important;
    border-color: #7c3aed !important;
}

/* Study Material Item Enhancements */
.study-material-item {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    position: relative;
}

.study-material-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

.study-material-item .material-type-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(124, 58, 237, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.study-material-item .material-subject {
    color: #7c3aed;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.study-material-item .material-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.study-material-item .material-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.study-material-item .material-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.study-material-item .material-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.study-material-item .material-actions {
    display: flex;
    gap: 0.5rem;
}

.view-material-btn, .download-btn, .bookmark-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.view-material-btn {
    background: #7c3aed;
    color: white;
}

.view-material-btn:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

.download-btn {
    background: #059669;
    color: white;
}

.download-btn:hover {
    background: #047857;
    transform: translateY(-1px);
}

.bookmark-btn {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.bookmark-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.bookmark-btn.bookmarked {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

/* Pagination Styles */
.pagination-btn {
    background: white;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination-btn:first-child {
    border-radius: 0.375rem 0 0 0.375rem;
}

.pagination-btn:last-child {
    border-radius: 0 0.375rem 0.375rem 0;
}

.pagination-btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.pagination-btn.active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: white;
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #7c3aed;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Full-Width Study Tips Banner */
.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-purple-600 {
    --tw-gradient-from: #7c3aed;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(124 58 237 / 0));
}

.to-purple-800 {
    --tw-gradient-to: #5b21b6;
}

.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

.bg-white\/15 {
    background-color: rgb(255 255 255 / 0.15);
}

.study-tips-banner {
    margin: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Study Tips Banner Button Hover Effects */
.study-tips-banner button {
    transition: all 0.3s ease;
}

.study-tips-banner button:hover {
    transform: translateY(-2px);
}

/* Resource Toggle Sections */
.resource-toggle-section {
    transition: all 0.3s ease;
}

.resource-toggle-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.resource-toggle-button {
    transition: all 0.3s ease;
}

.resource-toggle-button:hover {
    transform: scale(1.02);
}

.resource-toggle-content {
    max-height: 0;
    opacity: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.resource-toggle-content.show {
    max-height: 500px;
    opacity: 1;
}

/* Resource Item Styles */
.resource-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.resource-item:hover {
    transform: translateX(4px);
    background: #f8fafc !important;
}

/* Arrow Animation */
.toggle-arrow {
    transition: transform 0.3s ease;
}

/* Resource Type Badges */
.resource-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* YouTube Link Styling */
.youtube-link {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.youtube-link:hover {
    text-decoration: underline;
}

/* Mobile Responsive for Toggle Sections */
@media (max-width: 768px) {
    .resource-toggle-section {
        margin-bottom: 1rem;
    }
    
    .resource-toggle-content {
        max-height: none;
    }
    
    .resource-toggle-content.show {
        max-height: none;
    }
}

/* Loading Animation for Toggle Content */
.resource-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.resource-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #7c3aed;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .study-material-item {
        margin: 0;
    }
    
    .study-tips-banner h2 {
        font-size: 1.75rem;
    }
    
    .study-tips-banner p {
        font-size: 1rem;
    }
    
    .study-tips-banner .bg-white\/15 {
        padding: 0.5rem 1rem;
    }
    
    .pagination-btn {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }
    
    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* Notification styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: 300px;
    max-width: 400px;
}

.notification.success {
    background: #10b981;
    color: white;
}

.notification.error {
    background: #ef4444;
    color: white;
}

.notification.info {
    background: #3b82f6;
    color: white;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.hide {
    opacity: 0;
    transform: translateX(100%);
}

/* Focus styles for accessibility */
.pagination-btn:focus,
.view-material-btn:focus,
.download-btn:focus,
.bookmark-btn:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .study-material-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}

/* Tab Styles */
.study-tab {
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.study-tab:hover {
    color: #7c3aed !important;
    border-color: #d1d5db;
}

.study-tab.active {
    color: #7c3aed !important;
    border-color: #7c3aed !important;
}

.study-tab.active span {
    background-color: #f3e8ff !important;
    color: #7c3aed !important;
}

.study-tab:not(.active) span {
    background-color: #f3f4f6 !important;
    color: #6b7280 !important;
}

/* Tab Content Styles */
#tab-content-grid {
    min-height: 400px;
}

/* Resource Cards for Tab Content */
.resource-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    position: relative;
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.resource-card .card-header {
    padding: 1.5rem;
}

.resource-card .card-category {
    color: #7c3aed;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.resource-card .card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.resource-card .card-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.resource-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid #f3f4f6;
    background: #f9fafb;
}

.resource-card .card-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.resource-card .card-actions {
    display: flex;
    gap: 0.5rem;
}

.resource-card .premium-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.resource-card .free-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Action Buttons */
.btn-primary {
    background: #7c3aed;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Enhanced Pagination Styles */
.pagination-btn {
    background: white;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:first-child {
    border-radius: 0.375rem 0 0 0.375rem;
}

.pagination-btn:last-child {
    border-radius: 0 0.375rem 0.375rem 0;
}

.pagination-btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.pagination-btn.active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state svg {
    width: 4rem;
    height: 4rem;
    color: #d1d5db;
    margin: 0 auto 1rem;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Search and Filter Controls */
.tab-search-filters {
    background: #f9fafb;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
}

.tab-search-filters .search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 24rem;
}

.tab-search-filters input[type="text"] {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
}

.tab-search-filters input[type="text"]:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.tab-search-filters select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tab-search-filters select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.tab-search-filters .clear-filters-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    color: #7c3aed;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-search-filters .clear-filters-btn:hover {
    background: #f3f4f6;
    color: #5b21b6;
}

/* Responsive adjustments for search and filter controls */
@media (max-width: 768px) {
    .tab-search-filters {
        padding: 0.75rem;
    }
    
    .tab-search-filters .search-input-wrapper {
        max-width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .tab-search-filters .filter-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tab-search-filters select {
        min-width: auto;
        flex: 1;
    }
}

/* Filter active states */
.tab-search-filters select:not([value=""]) {
    background: #fef3c7;
    border-color: #f59e0b;
}

.tab-search-filters input[type="text"]:not([value=""]) {
    background: #fef3c7;
    border-color: #f59e0b;
}

/* Search icon positioning */
.search-icon-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.search-icon-wrapper svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .study-tab {
        padding: 1rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .study-tab svg {
        width: 1rem;
        height: 1rem;
        margin-right: 0.25rem;
    }
    
    .resource-card .card-header {
        padding: 1rem;
    }
    
    .resource-card .card-meta {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}
