/* AlgoNest Custom CSS */

/* Global Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-info: linear-gradient(135deg, #0dcaf0 0%, #0d6efd 100%);
    --gradient-success: linear-gradient(135deg, #198754 0%, #20c997 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    min-height: 60vh;
    display: flex;
    align-items: center;
    color: #ffffff;
}

.hero-section-enhanced {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e8ba3 100%);
    position: relative;
    overflow: hidden;
}

.hero-section-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.05) 50%, rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
}

.hero-section-enhanced::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content h2 {
    font-weight: 300;
    opacity: 0.95;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-section-enhanced .hero-content h2 {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.hero-section-enhanced .lead {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 400;
}

.hero-section-enhanced .btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border: none;
    color: #2c3e50;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.hero-section-enhanced .btn-warning:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
    color: #2c3e50;
}

.hero-section-enhanced .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.8);
    color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.hero-section-enhanced .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
    color: #1e3c72;
    transform: translateY(-2px);
}

.hero-image i {
    opacity: 0.8;
    animation: float 3s ease-in-out infinite;
}

.hero-section-enhanced .hero-image i {
    color: rgba(255, 255, 255, 0.7);
}

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

/* Enhanced Hero Section Accessibility */
@media (prefers-contrast: high) {
    .hero-section-enhanced {
        background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    }
    
    .hero-section-enhanced .hero-content h2 {
        color: #ffffff;
        text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
    }
    
    .hero-section-enhanced .lead {
        color: #ffffff;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-section-enhanced::after {
        animation: none;
    }
    
    .hero-image i {
        animation: none;
    }
}

/* Page Headers */
.page-header {
    background: var(--gradient-primary);
    color: #ffffff;
}

.page-header h1 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.page-header p {
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Cards */
.card {
    border: none;
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.hover-card {
    transition: all 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Buttons */
.btn {
    border-radius: 50px;
    font-weight: 600;
    padding: 12px 30px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
    border: 2px solid transparent;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-lg {
    padding: 15px 40px;
    font-size: 16px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Instructor Section Styling */
.instructor-avatar img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.instructor-avatar:hover img {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

/* Responsive instructor image */
@media (max-width: 768px) {
    .instructor-avatar img {
        max-width: 200px !important;
    }
}

@media (max-width: 576px) {
    .instructor-avatar img {
        max-width: 180px !important;
    }
}

/* About Instructor Section */
.bg-light {
    background-color: #f8f9fa !important;
}

.instructor-section {
    position: relative;
}

.instructor-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(25, 135, 84, 0.05) 100%);
    pointer-events: none;
}

.instructor-content {
    position: relative;
    z-index: 2;
}

.instructor-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
}

.instructor-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(13, 110, 253, 0.2);
}

/* Indian Currency and Pricing Styling */
.price-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.original-price {
    text-decoration: line-through;
    opacity: 0.7;
    font-size: 0.9rem;
}

.discount-badge {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.currency-symbol {
    font-weight: 600;
    color: var(--primary-color);
}

/* Course Card Enhancements */
.card .badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.language-badge {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

/* Image blur-up placeholder */
.blur-up {
    filter: blur(10px);
    transform: scale(1.02);
    transition: filter 400ms ease, transform 400ms ease, opacity 400ms ease;
    background-color: #f3f4f6;
}
.blur-up.loaded {
    filter: none;
    transform: none;
    opacity: 1;
}

/* Logo Styling */
.navbar-brand img {
    transition: transform 0.3s ease;
    height: auto;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.hero-logo {
    animation: fadeInUp 0.8s ease-out;
    margin-bottom: 2rem;
}

.hero-logo img {
    height: auto;
}

.footer-logo {
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.footer-logo:hover {
    opacity: 1;
}

.footer-logo img {
    height: auto;
}

/* Responsive logo sizing */
@media (max-width: 768px) {
    .navbar-brand img {
        width: 150px !important;
        height: auto !important;
    }
    
    .hero-logo img {
        width: 250px !important;
        height: auto !important;
    }
    
    .footer-logo img {
        width: 140px !important;
        height: auto !important;
    }
}

@media (max-width: 576px) {
    .navbar-brand img {
        width: 120px !important;
        height: auto !important;
    }
    
    .hero-logo img {
        width: 200px !important;
        height: auto !important;
    }
    
    .footer-logo img {
        width: 120px !important;
        height: auto !important;
    }
}

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff !important;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 25px;
    margin: 0 5px;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 15px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    color: #ffffff !important;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #212529 0%, #343a40 100%);
}

footer a {
    transition: all 0.3s ease;
}

footer a:hover {
    color: var(--primary-color) !important;
    transform: translateX(5px);
}

/* Blog Styles */
.blog-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--dark-color);
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.3;
}

.blog-content h1 { font-size: 2.5rem; }
.blog-content h2 { font-size: 2rem; }
.blog-content h3 { font-size: 1.75rem; }
.blog-content h4 { font-size: 1.5rem; }
.blog-content h5 { font-size: 1.25rem; }
.blog-content h6 { font-size: 1.1rem; }

.blog-content p {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.blog-content ul,
.blog-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    color: var(--dark-color);
}

.blog-content li {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.blog-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    background-color: var(--light-color);
    padding: 1rem 1.5rem;
    border-radius: 0 10px 10px 0;
    color: var(--dark-color);
}

.blog-content code {
    background-color: #f1f3f5;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #d6336c;
}

.blog-content pre {
    background-color: #f1f3f5;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    color: var(--dark-color);
}

.blog-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    color: var(--dark-color);
}

.blog-content th,
.blog-content td {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    text-align: left;
    color: var(--dark-color);
}

.blog-content th {
    background-color: var(--light-color);
    font-weight: 600;
    color: var(--dark-color);
}

/* Forms */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 20px;
    transition: all 0.3s ease;
    font-size: 15px;
    line-height: 1.5;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

.form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 20px;
    font-size: 15px;
    line-height: 1.5;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-size: 14px;
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Stats Section */
.stat-item h3 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Learning Path */
.step-number {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.file-upload-area.border-primary {
    border-color: var(--primary-color) !important;
    background-color: rgba(13, 110, 253, 0.1) !important;
}

/* Accordion */
.accordion-button {
    font-weight: 600;
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-color);
    color: white;
}

/* Testimonials */
blockquote {
    border-left: 4px solid var(--primary-color);
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .btn-lg {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content h2 {
        font-size: 1.2rem;
    }
    
    .display-4 {
        font-size: 1.75rem;
    }
    
    .display-5 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0b5ed7;
}

/* Loading spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Accessibility and High Contrast Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    .form-control {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #ffffff;
    }
    
    .form-control:focus {
        background-color: #2d3748;
        border-color: var(--primary-color);
        color: #ffffff;
    }
    
    .blog-content code {
        background-color: #2d3748;
        color: #f687b3;
    }
    
    .blog-content pre {
        background-color: #2d3748;
        color: #ffffff;
    }
}

/* Focus indicators for better accessibility */
.btn:focus,
.nav-link:focus,
.form-control:focus,
.form-select:focus,
.card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-to-main:focus {
    top: 6px;
}

/* Better contrast for text on colored backgrounds */
.text-white {
    color: #ffffff !important;
}

.bg-primary .text-muted {
    color: rgba(255, 255, 255, 0.85) !important;
}

.bg-dark .text-muted {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Improved readability */
.lead {
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--dark-color);
}

/* Better form labels */
.form-label.required::after {
    content: " *";
    color: var(--danger-color);
}

/* Error states */
.form-control.is-invalid {
    border-color: var(--danger-color);
    background-image: none;
}

.form-control.is-valid {
    border-color: var(--success-color);
    background-image: none;
}

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@media print {
    .navbar,
    .page-header,
    footer,
    .btn,
    .share-section,
    .newsletter-section {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Dev disclaimer modal styling */
#devDisclaimerModal .modal-header {
    background: linear-gradient(90deg,#fff3cd,#ffe8a1);
    border-bottom: 1px solid #ffeeba;
}
#devDisclaimerModal .modal-title {
    color: #664d03;
    font-weight: 700;
}
#devDisclaimerModal .modal-body {
    font-size: .95rem;
    color: #333;
}
@media (max-width: 576px) {
    #devDisclaimerModal .modal-body { font-size: .9rem; }
}
