﻿/* ============================================
   BASE STYLES
   ============================================ */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ============================================
   BLAZOR ERROR BOUNDARY
   ============================================ */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ============================================
   FLOATING PLACEHOLDERS
   ============================================ */
.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;
}

.form-floating > label {
    padding: 1rem 1.25rem;
}

/* ============================================
   CARDS & GENERAL UI
   ============================================ */
.card {
    transition: all 0.3s ease;
    border-radius: 12px;
}

    .card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important;
    }

.hero-section {
    background-attachment: fixed;
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 300px !important;
    }

        .hero-section h1 {
            font-size: 1.75rem !important;
        }
}

/* ============================================
   AUTHENTICATION STYLES
   ============================================ */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    background-color: #f4f7f6;
    padding: 2rem 1rem;
}

.auth-bg {
    min-height: calc(100vh - 80px);
    display: grid;
    place-items: center;
    background: radial-gradient(1200px 600px at 100% 0, #e8f5e9 0, transparent 60%), radial-gradient(1000px 500px at 0 100%, #fff8e1 0, transparent 60%), linear-gradient(135deg, #f8fbff 0%, #fefefe 100%);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 640px;
    background: #fff;
    border-radius: 18px;
    padding: 2rem;
    border: 1px solid #eef2f7;
}

.auth-header {
    text-align: center;
    margin-bottom: 1rem;
}

    .auth-header h1 {
        margin: .25rem 0;
        font-weight: 800;
    }

    .auth-header p {
        margin: 0;
        color: #607d8b;
    }

.auth-logo {
    max-width: 150px;
    margin-bottom: 1.5rem;
}

.auth-btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    background-color: #0d6efd;
    border: none;
}

    .auth-btn:hover {
        background-color: #0b5ed7;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(13,110,253,0.3);
    }

.form-text-link {
    font-size: 0.9rem;
    color: #0d6efd;
    text-decoration: none;
}

    .form-text-link:hover {
        text-decoration: underline;
    }

/* External logins */
.external-logins form {
    display: block;
    width: 100%;
}

.external-logins .btn {
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    font-weight: 600;
}

/* ============================================
   DIVIDER
   ============================================ */
.or-divider,
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #adb5bd;
    margin: 2rem 0;
}

    .or-divider::before,
    .or-divider::after,
    .divider::before,
    .divider::after {
        content: '';
        flex: 1;
        border-bottom: 1px solid #e0e0e0;
    }

    .or-divider span,
    .divider span {
        padding: 0 1rem;
        font-size: 0.85rem;
        font-weight: 600;
        background: #fff;
    }

/* ============================================
   CONFIRM PAGE
   ============================================ */
.confirm-container {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(1200px 600px at 100% 0, #e3f2fd 0, transparent 60%), radial-gradient(1000px 500px at 0 100%, #fff3e0 0, transparent 60%), linear-gradient(135deg, #f8fbff 0%, #fefefe 100%);
    padding: 2rem;
}

.confirm-card {
    width: 100%;
    max-width: 640px;
    background: #ffffffcc;
    backdrop-filter: blur(8px);
    border-radius: 18px;
    padding: 2.2rem;
    border: 1px solid #eef2f7;
}

.state {
    text-align: center;
}

    .state h2 {
        margin: .5rem 0 0.25rem;
        font-weight: 800;
        letter-spacing: .2px;
    }

    .state p {
        color: #5f6b7a;
        margin: 0.25rem 0 1rem;
    }

.confirm-card .spinner {
    width: 56px;
    height: 56px;
    border: 5px solid #e3f2fd;
    border-top-color: #1976d2;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

.icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 0.6rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 46px;
    font-weight: 900;
}

    .icon.success {
        background: #e8f5e9;
        color: #2e7d32;
        border: 2px solid #c8e6c9;
    }

    .icon.error {
        background: #ffebee;
        color: #c62828;
        border: 2px solid #ffcdd2;
    }

/* ============================================
   SIMPLE INPUTS
   ============================================ */
.input {
    padding: .85rem 1rem;
    border: 1px solid #e0e6ef;
    border-radius: 12px;
    width: 100%;
    outline: none;
    transition: border-color .15s;
}

    .input:focus {
        border-color: #90caf9;
    }

    .input.invalid {
        border-color: #ef9a9a;
    }

.invalid-text {
    color: #c62828;
    font-size: .9rem;
    margin-top: .25rem;
}

/* Password field helpers */
.password .password-box {
    position: relative;
}

.password .eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    opacity: .7;
}

/* ============================================
   CUSTOM BUTTONS
   ============================================ */
.btn.primary {
    width: 100%;
    background: linear-gradient(135deg, #6a1b9a, #ab47bc);
    color: #fff;
    border-color: #6a1b9a;
    display: inline-flex;
    gap: .6rem;
    align-items: center;
    justify-content: center;
}

    .btn.primary:hover {
        filter: brightness(1.05);
    }

.btn.outline {
    background: #fff;
    color: #6a1b9a;
    border: 1px solid #e1bee7;
}

/* ============================================
   TOASTS
   ============================================ */
.toast {
    opacity: 0.95;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 280px;
}

    .toast.text-bg-danger {
        background: linear-gradient(45deg, #dc3545, #c82333);
    }

    .toast.text-bg-warning {
        background: linear-gradient(45deg, #ffc107, #e0a800);
    }

    .toast.text-bg-success {
        background: linear-gradient(45deg, #28a745, #218838);
    }

    .toast.text-bg-info {
        background: linear-gradient(45deg, #17a2b8, #138496);
    }

/* ============================================
   USER & ROLE MANAGEMENT
   ============================================ */
.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
}

    .stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0,123,255,0.2) !important;
    }

.stat-icon {
    font-size: 3rem;
    opacity: 0.2;
}

.avatar-placeholder {
    width: 30px;
    height: 30px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
}

.role-selection {
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

    .role-selection .form-check {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        background: white;
        border-radius: 6px;
        transition: all 0.2s ease;
    }

        .role-selection .form-check:hover {
            background: #e7f3ff;
            transform: translateX(5px);
        }

/* ============================================
   GRADIENT HELPERS
   ============================================ */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #48c774 0%, #38a169 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
}

/* ============================================
   NAV TABS CUSTOM
   ============================================ */
.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 500;
    transition: all 0.3s ease;
}

    .nav-tabs .nav-link:hover {
        border-color: transparent;
        color: #667eea;
    }

    .nav-tabs .nav-link.active {
        color: #667eea;
        border-bottom-color: #667eea;
        background-color: transparent;
    }

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
.table-responsive::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.role-selection::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.role-selection::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.role-selection::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

    .table-responsive::-webkit-scrollbar-thumb:hover,
    .modal-body::-webkit-scrollbar-thumb:hover,
    .role-selection::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* ============================================
   ACCESS DENIED
   ============================================ */
.access-denied-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem;
}

.access-denied-content {
    max-width: 800px;
    width: 100%;
    text-align: center;
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.access-denied-icon {
    animation: shake 0.5s ease-in-out;
}

/* ============================================
   AUTH LOADING OVERLAY
   ============================================ */
.auth-loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-loading-content {
    text-align: center;
    color: white;
}

.spinner-wrapper {
    position: relative;
    display: inline-block;
}

.spinner-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    animation: glow-pulse 2s ease-in-out infinite;
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in,
.animate-fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

.spinner {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.5);
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

@keyframes glow-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ============================================
   PROFILE MANAGEMENT - 2FA
   ============================================ */
input.letter-spacing-wide {
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }

    .btn-group {
        display: flex;
        flex-direction: column;
    }

        .btn-group .btn {
            border-radius: 8px !important;
            margin-bottom: 0.5rem;
        }

    .avatar-placeholder {
        width: 100px;
        height: 100px;
    }

    .auth-container {
        padding: 1rem 0.5rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        box-shadow: none;
        border: none;
        background-color: transparent;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Loading Screen */
.loading-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,144C960,149,1056,139,1152,128C1248,117,1344,107,1392,101.3L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .hover-lift:hover {
        transform: translateY(-10px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.2) !important;
    }

/* Step Numbers */
.step-number {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* Gradient Background */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.text-purple {
    color: #764ba2 !important;
}

.bg-purple {
    background-color: #764ba2 !important;
}

/* Icon Box */
.icon-box {
    transition: transform 0.3s ease;
}

.hover-lift:hover .icon-box {
    transform: scale(1.1);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .display-3 {
        font-size: 2.5rem !important;
    }

    .display-5 {
        font-size: 2rem !important;
    }
}
@keyframes pulse-border {
    0%, 100% {
        border-color: rgba(220, 53, 69, 0.5);
    }

    50% {
        border-color: rgba(220, 53, 69, 1);
    }
}

.pulse-border {
    animation: pulse-border 2s infinite;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}
.tree-container {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.network-node {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

    .network-node:hover {
        border-color: #0d6efd;
        box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
    }

.children-container {
    margin-left: 30px;
    border-left: 2px dashed #dee2e6;
    padding-left: 20px;
    margin-top: 10px;
}
.modal-content {
    border-radius: 12px;
    border: none;
}

.modal-header.bg-gradient {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

textarea#messageTemplate {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

/* Checkbox scale */
.form-check-input:checked {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}