﻿/* ========================================
   Dira Shared Styles
   Shared CSS for all Dira projects
   ======================================== */

/* Google Fonts - Sora */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@100;200;300;400;500;600;700;800&display=swap');

/* ========================================
   Base Typography
   ======================================== */

html, body {
    font-family: 'Sora', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.mud-typography {
    font-family: 'Sora', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
}

h1:focus {
    outline: none;
}

/* ========================================
   Links and Buttons Base
   ======================================== */

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ========================================
   Content Layout
   ======================================== */

.content {
    padding-top: 1.1rem;
}

/* ========================================
   Form Validation Styles
   ======================================== */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* ========================================
   Blazor Error UI
   ======================================== */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2x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NjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* ========================================
   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);
}

.loading-progress circle:last-child {
    stroke: #F07015;
    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;
}

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

/* ========================================
   Loading Screen
   ======================================== */

#loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #ffffff;
}

#loading-screen img {
    width: 100px;
    margin-bottom: 20px;
}

#loading-screen p {
    font-family: 'Sora', Arial, sans-serif;
    font-size: 16px;
    color: #333;
}

/* ========================================
   Code Blocks
   ======================================== */

code {
    color: #c02d76;
}

/* ========================================
   MudBlazor Overrides
   ======================================== */

/* Make all MudIconButton components circular */
.mud-icon-button {
    border-radius: 50% !important;
}

/* Blurred App Bar */
.blurred-appbar {
    background-color: #ffffff;
    background-color: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

/* ========================================
   Card Hover Effects
   ======================================== */

/* Standard card with lift effect on hover */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

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

/* Subtle card hover - smaller lift */
.card-hover-subtle {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

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

/* Scale card hover - grows slightly */
.card-hover-scale {
    transition: transform 0.2s ease;
    cursor: pointer;
}

.card-hover-scale:hover {
    transform: scale(1.03);
}

/* Small scale for compact elements */
.card-hover-scale-sm {
    transition: transform 0.2s ease;
    cursor: pointer;
}

.card-hover-scale-sm:hover {
    transform: scale(1.05);
}

/* Glow effect on hover */
.card-hover-glow {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.card-hover-glow:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(240, 112, 21, 0.25) !important;
}

/* Combined lift and border highlight */
.card-hover-highlight {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.card-hover-highlight:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
    border-color: #F07015;
}

/* Feature card style (used in landing page) */
.feature-card {
    border-radius: 16px;
    background: #f9f9f9;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Category card style */
.category-card {
    border-radius: 12px;
    transition: transform 0.2s ease;
    cursor: pointer;
}

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

/* ========================================
   Animation Keyframes
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

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

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

/* ========================================
   Animation Utility Classes
   ======================================== */

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

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

.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.4s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.4s ease-out forwards;
}

/* Staggered animation delays for lists */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }
.stagger-9 { animation-delay: 0.45s; }
.stagger-10 { animation-delay: 0.5s; }

/* ========================================
   Component Animations
   ======================================== */

/* Button press effect */
.btn-press:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Like button animation */
.like-btn.liked {
    animation: heartBeat 0.6s ease-in-out;
}

/* Skeleton shimmer effect */
.mud-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Page content fade in */
#page-content {
    animation: fadeIn 0.3s ease-out;
}

/* Dialog/Popup animation */
.mud-dialog {
    animation: scaleIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Drawer slide animation */
.mud-drawer--open {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tooltip fade */
.mud-tooltip {
    animation: fadeIn 0.15s ease-out;
}

/* Chip hover effect */
.mud-chip:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

/* ========================================
   Primary Action Button (Dira Orange)
   ======================================== */

.btn-primary-action {
    position: relative;
    background: linear-gradient(135deg, #F07015 0%, #D65D0A 50%, #FF8E63 100%) !important;
    background-size: 200% 200% !important;
    background-position: 0% 50% !important;
    color: white !important;
    font-weight: 600 !important;
    border-radius: 24px !important;
    text-transform: none !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    overflow: hidden;
    border: none !important;
}

.btn-primary-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0) 60%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
}

.btn-primary-action:hover {
    background-position: 100% 50% !important;
    transform: none;
    box-shadow: none !important;
}

.btn-primary-action:hover::before {
    opacity: 1;
}

.btn-primary-action:active {
    transform: scale(0.98);
}

/* Secondary action button - outlined style */
.btn-secondary-action {
    border: 1px solid #e0e0e0 !important;
    background-color: transparent !important;
    color: #424242 !important;
    font-weight: 500 !important;
    border-radius: 24px !important;
    text-transform: none !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.btn-secondary-action:hover {
    background-color: #f5f5f5 !important;
    border-color: #bdbdbd !important;
    box-shadow: none !important;
}

/* Tertiary action button - text style */
.btn-tertiary-action {
    color: #F07015 !important;
    font-weight: 500 !important;
    text-transform: none !important;
    transition: all 0.2s ease !important;
    border-radius: 24px !important;
}

.btn-tertiary-action:hover {
    background-color: rgba(240, 112, 21, 0.08) !important;
}

/* Large action buttons (for CTAs) */
.btn-large-cta {
    padding: 12px 32px !important;
    font-size: 16px !important;
    border-radius: 28px !important;
}

/* ========================================
   MudDataGrid & MudTable - Responsive Fill
   ======================================== */

/* Container for full-height data grids */
.datagrid-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px); /* Account for app bar and padding */
    min-height: 400px;
}

/* MudDataGrid fills available space */
.mud-data-grid,
.datagrid-container .mud-data-grid {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    min-height: 0; /* Important for flex child scrolling */
}

/* DataGrid table container scrolls */
.mud-data-grid .mud-table-container {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

/* Full-width data grid */
.mud-data-grid-fullwidth,
.datagrid-fullwidth {
    width: 100%;
}

/* MudTable fills available space */
.mud-table,
.datagrid-container .mud-table {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    min-height: 0;
}

.mud-table .mud-table-container {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

/* Sticky header for data grids */
.mud-data-grid .mud-table-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--mud-palette-surface);
}

.mud-table .mud-table-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--mud-palette-surface);
}

/* Sticky footer/pager for data grids */
.mud-data-grid .mud-table-pagination {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background-color: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
}

.mud-table .mud-table-pagination {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background-color: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* Page container that fills viewport */
.page-fill-height {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px); /* Account for app bar */
    overflow: hidden;
}

/* Content area within page that grows */
.page-content-grow {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Card that fills available space */
.card-fill-height {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.card-fill-height .mud-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

/* ========================================
   Accessibility - Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

