/**
 * ===========================================
 * Sri Sakthi Vinayaga E Sevai Maiyam
 * Main Stylesheet
 * ===========================================
 */

:root {
    /* Color Palette */
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    
    /* Light Theme (Default) */
    --bg-body: #f3f4f6;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-hover: rgba(255, 255, 255, 0.85);
    --text-primary: #1f2937;
    --text-muted: #4b5563;
    --border-color: rgba(255, 255, 255, 0.3);
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow-md: 0 .5rem 1rem rgba(0,0,0,.15);
    --shadow-lg: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    
    /* Typography */
    --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
    --font-display: 'Syne', system-ui, -apple-system, sans-serif;
}

[data-bs-theme="dark"] {
    /* Dark Theme */
    --bg-body: #0f111a;
    --bg-card: rgba(30, 32, 45, 0.5);
    --bg-glass: rgba(30, 32, 45, 0.5);
    --bg-glass-hover: rgba(45, 48, 65, 0.6);
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.05);
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.25);
    --shadow-md: 0 .5rem 1rem rgba(0,0,0,.35);
    --shadow-lg: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* Base Styles */
body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 15% 50%, rgba(99,102,241,0.15), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(236,72,153,0.15), transparent 25%);
    z-index: -1;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6, .brand-text {
    font-family: var(--font-display);
    color: var(--text-primary);
}

/* Glassmorphism Utilities */
.bg-glass {
    background-color: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
}

.glass-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
}

[data-bs-theme="dark"] .card {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .text-dark {
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: var(--bg-card) !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
}

/* Navigation */
.navbar-glass {
    background-color: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 6rem 0 4rem;
}

.hero-blob {
    position: absolute;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.4;
    border-radius: 50%;
}

.hero-blob-1 {
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.3), rgba(13, 202, 240, 0.3));
}

.hero-blob-2 {
    bottom: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.2), rgba(13, 110, 253, 0.2));
}

[data-bs-theme="dark"] .hero-blob {
    opacity: 0.15;
}

/* Search Bar */
.search-container {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.search-container:focus-within {
    box-shadow: var(--shadow-md) !important;
    border-color: var(--primary-color) !important;
}

.search-container input:focus {
    color: var(--text-primary);
}

/* Categories Sidebar */
.category-list .list-group-item {
    background-color: transparent;
    transition: all 0.2s ease;
}

.category-list .list-group-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
    padding-left: 1.5rem;
}

.category-list .list-group-item.active {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color) !important;
}

[data-bs-theme="dark"] .category-list .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Link Cards */
.link-card {
    background-color: var(--bg-card);
    border-radius: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    cursor: pointer;
}

.card-hover-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(13, 110, 253, 0.03) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.link-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg) !important;
}

.link-card:hover .card-hover-bg {
    opacity: 1;
}

.link-card:hover .icon-wrapper {
    transform: scale(1.1);
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

.link-card:hover .icon-wrapper i {
    color: #fff !important;
}

.link-card:hover h6 {
    color: var(--primary-color) !important;
}

.link-card:hover .external-link-icon {
    opacity: 1 !important;
}

.transition-transform {
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.transition-opacity {
    transition: opacity 0.3s ease;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Form Styling */
.form-control, .form-select {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .form-control::-webkit-input-placeholder {
    color: var(--text-muted);
}

/* Auth Cards */
.auth-card {
    border-radius: 1.5rem;
    overflow: hidden;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Utilities */
.hover-primary:hover {
    color: var(--primary-color) !important;
}

.hover-opacity:hover {
    opacity: 0.8;
}

.transition-colors {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
    .hero-section {
        padding: 4rem 0 2rem;
    }
    
    h1.display-4 {
        font-size: 2.5rem;
    }
    
    .link-card-wrapper {
        padding: 0 0.5rem;
    }
}
