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

/* Global Styles */
html, body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
}

/* Hero Title Font */
.hero-title {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Hero Logo & Text Layout */
.hero-logo-text {
    flex-wrap: wrap;
}

.hero-logo {
    height: 120px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

/* Responsive Hero Layout */
@media (max-width: 767.98px) {
    .hero-logo-text {
        flex-direction: column !important;
        gap: 1rem;
    }
    
    .hero-logo {
        height: 80px;
        margin-right: 0 !important;
        margin-bottom: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 991.98px) and (min-width: 768px) {
    .hero-logo {
        height: 100px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
}

/* Dark mode support using Bootstrap 5.3 color-mode */
[data-bs-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #dee2e6;
    --bs-card-bg: #2b3035;
    --bs-card-border-color: #495057;
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

main {
    flex: 1 0 auto;
}

/* Navbar Styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
}

[data-bs-theme="dark"] .navbar {
    box-shadow: 0 2px 4px rgba(255,255,255,.08);
}

.navbar-brand {
    font-size: 1.25rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: rgba(255, 255, 255, 1);
}

.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
    font-weight: 600;
}

/* Background Gradient - adapts to dark mode */
.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

[data-bs-theme="dark"] .bg-primary {
    background: linear-gradient(135deg, #5a67d8 0%, #6a4190 100%) !important;
}

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

[data-bs-theme="dark"] .bg-light {
    background-color: #1a1d23 !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 500px;
}

[data-bs-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #5a67d8 0%, #6a4190 100%);
}

.schema-preview {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
}

/* Project Link Cards */
.project-link-card {
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.project-link-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15) !important;
}

[data-bs-theme="dark"] .project-link-card {
    border-color: #495057;
}

[data-bs-theme="dark"] .project-link-card:hover {
    box-shadow: 0 12px 24px rgba(0,0,0,0.5) !important;
}

.project-link-card svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.project-link-card:hover svg {
    transform: scale(1.1);
}

/* Demo Button Styling */
.btn-outline-light {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    color: #667eea;
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-outline-light:active {
    transform: translateY(0);
}

/* Feature Cards - Dark Mode Fix */
.bg-white {
    background-color: #ffffff !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #1a1d23 !important;
}

/* Feature Section Headings */
.display-5 {
    color: inherit;
}

[data-bs-theme="dark"] .display-5 {
    color: #f8f9fa;
}

.lead {
    color: inherit;
}

[data-bs-theme="dark"] .lead {
    color: #adb5bd;
}

.text-muted {
    color: #6c757d !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

/* Feature Cards */
.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto;
}

[data-bs-theme="dark"] .feature-icon {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
}

/* Step Numbers */
.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
}

[data-bs-theme="dark"] .step-number {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="dark"] .btn-light:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

/* Form Controls */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #343a40;
    border-color: #495057;
    color: #dee2e6;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #6c757d;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--bs-card-bg, #ffffff);
}

[data-bs-theme="dark"] .card {
    background-color: #2b3035;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid #495057;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

[data-bs-theme="dark"] .card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
}

.card-header h4,
.card-header h5,
.card-header h6 {
    color: white;
}

.card-title {
    color: inherit;
}

[data-bs-theme="dark"] .card-title {
    color: #f8f9fa;
}

.card-text {
    color: inherit;
}

[data-bs-theme="dark"] .card-text {
    color: #adb5bd;
}

/* Footer */
.footer {
    flex-shrink: 0;
}

[data-bs-theme="dark"] .footer {
    background-color: #212529 !important;
    border-top-color: #495057 !important;
}

/* Entity Preview */
.entity-preview {
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .entity-preview {
    background: #343a40;
    border-color: #495057;
}

.entity-preview:hover {
    background: #e9ecef;
    border-color: #667eea;
}

[data-bs-theme="dark"] .entity-preview:hover {
    background: #495057;
    border-color: #667eea;
}

.analysis-results {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 15px;
}

[data-bs-theme="dark"] .analysis-results {
    background: #155724;
    border-color: #1c7430;
    color: #d4edda;
}

.analyze-page {
    padding: 40px 0;
}

/* Loading Progress */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

[data-bs-theme="dark"] .loading-progress circle {
    stroke: #495057;
}

.loading-progress circle:last-child {
    stroke: #667eea;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: inherit;
}

[data-bs-theme="dark"] .loading-progress-text {
    color: #dee2e6;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* Blazor Error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

[data-bs-theme="dark"] #blazor-error-ui {
    background: #856404;
    color: #fff;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Input Group Icons */
.input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #343a40;
    border-color: #495057;
    color: #dee2e6;
}

/* Code Blocks */
code {
    background: #f8f9fa;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.875em;
    color: #495057; /* Changed from #d63384 (red) to neutral gray */
}

[data-bs-theme="dark"] code {
    background: #343a40;
    color: #adb5bd; /* Lighter gray for dark mode */
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Spinner */
.spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
    border-width: 0.15em;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 1rem;
    }
    
    .navbar-nav {
        gap: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    .display-3 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1.1rem;
    }
    
    .hero-section {
        min-height: 400px;
    }
    
    /* Stack demo button vertically on mobile */
    .form-text {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    
    .form-text .btn {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer {
        display: none;
    }
    
    main {
        margin: 0;
        padding: 0;
    }
}