/* Custom styles for InstaDraft */

/* Brand Colors */
:root {
    --brand-primary: #298fed;
    --brand-primary-hover: #1a7ad9;
    --brand-primary-light: rgba(41, 143, 237, 0.1);
    --brand-primary-rgb: 41, 143, 237;
}

/* Prevent double scrollbars */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

#app {
    height: 100%;
    overflow: hidden;
}

/* FluentBodyContent fix */
fluent-body-content {
    width: 100%;
    display: block;
}

/* Main Content fix */
.main-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

/* Header Logo */
.header-logo {
    height: 32px;
    width: auto;
    margin-left: 16px;
}

/* Header Login Button - Theme Aware */
.header-login-button::part(control) {
    color: var(--accent-fill-rest) !important;
    border: 2px solid var(--accent-fill-rest) !important;
    background: transparent !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    transition: all 0.3s ease !important;
    border-radius: 8px !important;
}

.header-login-button:hover::part(control) {
    background: var(--accent-fill-rest) !important;
    color: var(--neutral-foreground-on-accent) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-shadow) !important;
}

/* FluentProfileMenu Styling */
fluent-profile-menu {
    cursor: pointer;
}

fluent-profile-menu::part(persona) {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

fluent-profile-menu::part(persona)::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-fill-rest), var(--accent-fill-hover));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(8px);
}

fluent-profile-menu:hover::part(persona) {
    transform: scale(1.05);
}

fluent-profile-menu:hover::part(persona)::before {
    opacity: 0.6;
    animation: avatarGlow 2s ease-in-out infinite;
}

@keyframes avatarGlow {
    0%, 100% {
        filter: blur(8px);
        transform: scale(1);
    }
    50% {
        filter: blur(12px);
        transform: scale(1.1);
    }
}

fluent-profile-menu:active::part(persona) {
    transform: scale(1.02);
}

/* Profile Menu Popover */
fluent-profile-menu::part(popover) {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--neutral-stroke-divider-rest);
}

/* Profile Menu Action Buttons - Microsoft Style */
.profile-menu-action {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: var(--accent-fill-rest);
}

.profile-menu-action::part(control) {
    justify-content: center;
}

.profile-menu-action:hover {
    background-color: var(--neutral-fill-secondary-hover);
}

.profile-menu-action.profile-menu-logout {
    color: var(--error);
}

.profile-menu-action.profile-menu-logout span {
    color: var(--error);
}

/* Remove old hover transform since we want centered buttons */
fluent-profile-menu fluent-button[appearance="lightweight"] {
    transition: all 0.2s ease;
}

fluent-profile-menu fluent-button[appearance="lightweight"]:hover {
    background-color: var(--neutral-fill-secondary-hover);
}

fluent-profile-menu fluent-button[appearance="lightweight"]:active {
    transform: scale(0.98);
}

/* Dialog Styling - Only visual styling, NO z-index */
fluent-dialog::part(dialog) {
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    min-width: 380px;
    max-width: 420px;
}

fluent-dialog fluent-dialog-body {
    padding: 20px 24px 24px;
}

fluent-dialog fluent-button[appearance="lightweight"] {
    transition: all 0.2s ease;
    padding: 10px 16px;
    border-radius: 8px;
}

fluent-dialog fluent-button[appearance="lightweight"]:hover {
    background-color: var(--neutral-fill-secondary-hover);
    transform: translateX(2px);
}

/* HERO BUTTON STYLES - Enhanced for theme awareness */
.hero-button-primary::part(control),
.hero-button-secondary::part(control) {
    height: 48px !important;
    padding: 0 32px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
}

.hero-button-primary::part(control) {
    background: white !important;
    color: var(--accent-fill-rest) !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

.hero-button-primary:hover::part(control) {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25) !important;
}

.hero-button-primary:active::part(control) {
    transform: translateY(0) !important;
}

.hero-button-secondary::part(control) {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px) !important;
}

.hero-button-secondary:hover::part(control) {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

.hero-button-secondary:active::part(control) {
    transform: translateY(0) !important;
}

/* Desktop Navigation Bar - Show on desktop */
.desktop-nav-bar {
    display: flex;
}

/* Mobile Navigation Bar - Completely hide on desktop */
.mobile-nav-bar {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

.desktop-login {
    display: flex;
}

.mobile-login {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Hide desktop nav completely */
    .desktop-nav-bar {
        display: none !important;
        visibility: hidden !important;
        position: absolute !important;
        width: 0 !important;
        height: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        overflow: hidden !important;
    }

    /* Show and position mobile nav at bottom */
    .mobile-nav-bar {
        display: flex !important;
        visibility: visible !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        overflow: visible !important;
        z-index: 1000 !important;
        background: white !important;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
        border-top: 1px solid var(--neutral-stroke-divider-rest) !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 8px 0 !important;
    }

    /* Center the items within mobile nav */
    .mobile-nav-bar::part(root) {
        justify-content: center !important;
        align-items: center !important;
        gap: 0 !important;
    }

    .desktop-login {
        display: none;
    }

    .mobile-login {
        display: flex;
    }

    .standard-content {
        padding: 16px !important;
        padding-bottom: 80px !important;
    }

    .home-content {
        padding: 0 !important;
        padding-bottom: 80px !important;
    }

    fluent-header {
        padding: 0 12px !important;
    }

    .header-logo {
        height: 28px;
        margin-left: 12px;
    }
}

/* Main Content Layouts */
.standard-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.home-content {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

/* Authentication Loading Screen */
.auth-loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(41, 143, 237, 0.08) 0%, rgba(26, 122, 217, 0.12) 100%);
    position: relative;
    overflow: hidden;
}

.auth-loading-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(41, 143, 237, 0.03) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

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

.auth-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 48px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(41, 143, 237, 0.2), 0 8px 20px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(41, 143, 237, 0.1);
    min-width: 400px;
}

.auth-loading-icon {
    animation: iconBounce 0.8s ease-out;
}

@keyframes iconBounce {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

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

@media (max-width: 768px) {
    .auth-loading-content {
        min-width: unset;
        margin: 20px;
        padding: 40px 32px;
    }
}

/* Brand Styled Components */
.action-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 3px solid var(--brand-primary);
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(41, 143, 237, 0.3);
    border-left-color: var(--brand-primary-hover);
}

.template-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-top: 3px solid var(--brand-primary);
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(41, 143, 237, 0.3);
}

.draft-item-card {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.draft-item-card:hover {
    background-color: var(--neutral-layer-2);
}

/* Validation styles are now handled by FluentUI */

#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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0"idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI26My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NzIgMjY3LjUzum9vc3Jlcy01My42MjgzIDI5MC44NzcgOTMuNTEzIDI5MSA9OC42NzgyIDI5MSA9Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA9NC4wODg2IDIzNi4wODkgOTMuODA3MlwzNi4zMzgxMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMtNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NzId2NjcNzkzIDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDg2Ni4wMTgzeiIgZmlsbD0iI0ZGRjUwMCIgZmlsbC1ydWxlPSJldmVub2lkZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* Splash Screen Styles */
.splash-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #298fed 0%, #1a7ad9 50%, #0d5fb8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
}

.splash-content {
    position: relative;
    z-index: 10;
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.splash-logo {
    margin-bottom: 32px;
    animation: logoFloat 3s ease-in-out infinite;
}

.splash-logo img {
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
    max-width: 500px;
    width: 100%;
    height: auto;
}

.splash-tagline {
    color: white;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 48px;
    opacity: 0.95;
    letter-spacing: 0.3px;
}

.splash-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loader-bar {
    width: 280px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.loader-progress {
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 255, 255, 1) 50%, 
        rgba(255, 255, 255, 0.8) 100%);
    border-radius: 2px;
    animation: progressAnimation 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.loader-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.splash-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.splash-decoration .decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(60px);
}

.splash-decoration .decoration-circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    animation: floatSplash 20s ease-in-out infinite;
}

.splash-decoration .decoration-circle-2 {
    width: 300px;
    height: 300px;
    bottom: -80px;
    right: -80px;
    animation: floatSplash 15s ease-in-out infinite reverse;
}

.splash-decoration .decoration-circle-3 {
    width: 250px;
    height: 250px;
    top: 50%;
    right: -50px;
    animation: floatSplash 18s ease-in-out infinite;
}

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

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

@keyframes progressAnimation {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

@keyframes floatSplash {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(20px, -20px) scale(1.05);
    }
    66% {
        transform: translate(-15px, 15px) scale(0.95);
    }
}

@media (max-width: 768px) {
    .splash-logo img {
        max-width: 280px;
        width: 90%;
        height: auto;
    }

    .splash-tagline {
        font-size: 16px;
        padding: 0 24px;
    }

    .loader-bar {
        width: 220px;
    }

    .splash-decoration .decoration-circle-1,
    .splash-decoration .decoration-circle-3 {
        display: none;
    }

    .splash-decoration .decoration-circle-2 {
        width: 250px;
        height: 250px;
    }
}

/* Legacy loading progress styles - kept for compatibility */
.loading-progress {
    display: none;
}

.loading-progress-text {
    display: none;
}

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Hero Button Styles */
.hero-button-primary {
    --button-height: 56px;
}

.hero-button-primary::part(control) {
    height: var(--button-height) !important;
    padding: 0 40px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%) !important;
    color: #1a7ad9 !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    letter-spacing: 0.3px !important;
    text-transform: none !important;
}

.hero-button-primary:hover::part(control) {
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%) !important;
}

.hero-button-primary:active::part(control) {
    transform: translateY(-2px) scale(1.01) !important;
    transition-duration: 0.1s !important;
}

/* Secondary Hero Button - Learn More */
.hero-button-secondary {
    --button-height: 56px;
}

.hero-button-secondary::part(control) {
    height: var(--button-height) !important;
    padding: 0 40px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: transparent !important;
    color: white !important;
    border: 2.5px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 12px !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    letter-spacing: 0.3px !important;
    backdrop-filter: blur(8px) !important;
    text-transform: none !important;
}

.hero-button-secondary:hover::part(control) {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.15) !important;
}

.hero-button-secondary:active::part(control) {
    transform: translateY(-2px) scale(1.01) !important;
    transition-duration: 0.1s !important;
}