/* OneClick Vakil Knowledge Bank Styles - React-like UI */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Gujarati:wght@300;400;500;600;700&display=swap');

/* CSS Variables for consistent theming */
:root {
    /* Primary Colors - Consistent #705cd6 theme */
    --primary: #705cd6;
    --primary-foreground: #ffffff;
    --primary-hover: #5a4bb8;
    --primary-light: #8b7ae6;

    /* Secondary Colors */
    --secondary: #6c757d;
    --secondary-foreground: #ffffff;
    --secondary-hover: #545b62;

    /* Background Colors */
    --background: #ffffff;
    --foreground: #212529;
    --muted: #f8f9fa;
    --muted-foreground: #6c757d;

    /* Border and Input */
    --border: #dee2e6;
    --input: #ffffff;
    --ring: #705cd6;

    /* Card Colors */
    --card: #ffffff;
    --card-foreground: #212529;

    /* Accent Colors */
    --accent: #e9ecef;
    --accent-foreground: #495057;

    /* Destructive Colors */
    --destructive: #dc3545;
    --destructive-foreground: #ffffff;

    /* Popover Colors */
    --popover: #ffffff;
    --popover-foreground: #212529;

    /* Border Radius */
    --radius: 0.75rem;

    /* Enhanced color palette */
    --primary-50: #e3f2fd;
    --primary-100: #bbdefb;
    --primary-200: #90caf9;
    --primary-300: #64b5f6;
    --primary-400: #42a5f5;
    --primary-500: #2196f3;
    --primary-600: #1e88e5;
    --primary-700: #1976d2;
    --primary-800: #1565c0;
    --primary-900: #0d47a1;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Gujarati', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 1.6;
    color: var(--foreground);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Noto Sans Gujarati', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    color: var(--foreground);
}

/* Enhanced Buttons */
.ref-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.ref-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.ref-btn:hover:before {
    left: 100%;
}

.ref-btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: var(--shadow);
}

.ref-btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.ref-btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
    border: 1px solid var(--border);
}

.ref-btn-secondary:hover {
    background: var(--muted);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.ref-btn-disabled {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    border-color: #dee2e6 !important;
    cursor: not-allowed !important;
    opacity: 0.65;
    pointer-events: none;
}

.ref-btn-disabled:hover {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    border-color: #dee2e6 !important;
    transform: none !important;
    box-shadow: none !important;
}

.ref-btn-disabled:before {
    display: none;
}

/* Enhanced Input Styles */
.ref-input {
    display: flex;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    color: var(--foreground);
    transition: all 0.2s ease-in-out;
}

.ref-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.ref-input::placeholder {
    color: var(--muted-foreground);
}

/* Enhanced Search Suggestions */
.search-suggestions {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

.search-suggestion-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background: var(--muted);
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-icon {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* Horizontal Category Slider */
.category-slider-wrapper {
    position: relative;
}

.category-slider {
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.category-slider::-webkit-scrollbar {
    display: none;
}

.category-slider:active {
    cursor: grabbing;
}

.category-slider-item {
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-slider-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 120px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.category-slider-card i {
    font-size: 1.5rem;
    color: #007bff;
    transition: all 0.3s ease;
}

.category-slider-card span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.category-slider-item:hover .category-slider-card {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border-color: #007bff;
}

.category-slider-item:hover .category-slider-card i {
    transform: scale(1.1);
    color: #0056b3;
}

.category-slider-item.active .category-slider-card {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.category-slider-item.active .category-slider-card i {
    color: white;
}

.category-slider-item.active .category-slider-card span {
    color: white;
}

.category-slider-fade-right {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2rem;
    background: linear-gradient(to right, transparent, #f8f9fa);
    pointer-events: none;
}

/* Enhanced Card Styles */
.course-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    position: relative;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(0, 123, 255, 0.3);
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-400));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.course-card:hover::before {
    transform: scaleX(1);
}

/* Enhanced Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    background: rgba(0, 123, 255, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 123, 255, 0.2);
}

.badge-success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border-color: rgba(40, 167, 69, 0.2);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.2);
}

/* Enhanced Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, var(--muted) 25%, rgba(248, 249, 250, 0.5) 50%, var(--muted) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

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

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Enhanced Focus States */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Enhanced Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.6s ease-out;
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .ref-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }

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

    h1 {
        font-size: 1.875rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-600));
    color: white;
}

/* Reference Card Component - Enhanced */
.ref-card {
    background: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ref-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(112, 92, 214, 0.2);
}

.ref-card:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(112, 92, 214, 0.02), rgba(139, 122, 230, 0.02));
    pointer-events: none;
}

/* Enhanced Gradient Backgrounds */
.gradient-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
    color: white !important;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

/* Enhanced Form Controls */
.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(112, 92, 214, 0.25) !important;
}

/* Enhanced Breadcrumb */
.ref-breadcrumb {
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.ref-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›" !important;
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-delay-100 {
    animation-delay: 0.1s;
}

.animate-delay-200 {
    animation-delay: 0.2s;
}

.animate-delay-300 {
    animation-delay: 0.3s;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

/* Course Cards */
.course-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.course-card .card-img-top {
    transition: transform 0.3s ease;
}

.course-card:hover .card-img-top {
    transform: scale(1.05);
}

/* Category Cards */
.category-card {
    transition: all 0.3s ease;
    border-radius: 12px;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
}

.category-icon {
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

/* Search Section */
.search-section {
    border-bottom: 1px solid #e9ecef;
}

.search-form .form-control:focus,
.search-form .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Topic Tree */
.topic-tree ul {
    border-left: 2px solid #e9ecef;
    margin-left: 1rem;
    padding-left: 1rem;
}

.topic-tree li {
    position: relative;
}

.topic-tree li::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 0.5rem;
    width: 0.5rem;
    height: 2px;
    background-color: #e9ecef;
}

.topic-tree a:hover {
    color: #007bff !important;
}

/* Topic Tree Sidebar */
.topic-tree-sidebar ul {
    border-left: 1px solid #dee2e6;
    margin-left: 0.5rem;
    padding-left: 0.5rem;
}

.topic-tree-sidebar li {
    position: relative;
}

.topic-tree-sidebar li::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 0.4rem;
    width: 0.3rem;
    height: 1px;
    background-color: #dee2e6;
}

/* Pricing Plans */
.pricing-plan {
    transition: all 0.3s ease;
}

.pricing-plan:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Language Switcher */
.language-switcher .btn {
    border-radius: 20px;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Topic Navigation */
.topic-navigation .btn {
    text-align: left;
    padding: 1rem;
    height: auto;
}

.topic-navigation .btn:hover {
    transform: translateX(5px);
}

.topic-navigation .btn:last-child:hover {
    transform: translateX(-5px);
}

/* Content Styling */
.topic-content h1,
.topic-content h2,
.topic-content h3,
.topic-content h4,
.topic-content h5,
.topic-content h6 {
    color: #2c3e50;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.topic-content h1 {
    border-bottom: 3px solid #007bff;
    padding-bottom: 0.5rem;
}

.topic-content h2 {
    border-bottom: 2px solid #6c757d;
    padding-bottom: 0.3rem;
}

.topic-content p {
    line-height: 1.7;
    margin-bottom: 1rem;
}

.topic-content ul,
.topic-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.topic-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.topic-content blockquote {
    border-left: 4px solid #007bff;
    background-color: #f8f9fa;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
}

.topic-content code {
    background-color: #f8f9fa;
    color: #e83e8c;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.topic-content pre {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.topic-content table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.topic-content table th,
.topic-content table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

.topic-content table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .course-card,
    .category-card {
        margin-bottom: 1rem;
    }
    
    .topic-navigation .btn {
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .language-switcher {
        margin-bottom: 1rem;
    }
}

/* Print Styles */
@media print {
    .hero-section,
    .search-section,
    .topic-navigation,
    .language-switcher,
    .card-header,
    .btn {
        display: none !important;
    }
    
    .topic-content {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .topic-content h1,
    .topic-content h2,
    .topic-content h3 {
        page-break-after: avoid;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .course-card,
    .category-card {
        border: 2px solid #000;
    }
    
    .hero-section {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .course-card,
    .category-card,
    .pricing-plan,
    .topic-navigation .btn {
        transition: none;
    }
    
    .course-card:hover,
    .category-card:hover,
    .pricing-plan:hover {
        transform: none;
    }
}
