@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700;800&display=swap');

:root {
    --firecad-primary: #eb542c;
    --firecad-primary-dark: #d13d18;
    --firecad-accent: #f58b36;
    --firecad-dark: #050505;
    --firecad-gray: #373636;
    --firecad-light-gray: #6b7280;
    --firecad-light-bg: #f9fafb;
    --firecad-border: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    color: var(--firecad-dark);
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--firecad-dark);
    line-height: 1.2;
}

a, .btn-link {
    color: var(--firecad-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover, .btn-link:hover {
    color: var(--firecad-primary-dark);
}

/* Modern Button Styles */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 12px 28px;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--firecad-primary) 0%, var(--firecad-primary-dark) 100%);
    box-shadow: 0 4px 14px 0 rgba(235, 84, 44, 0.3);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: linear-gradient(135deg, var(--firecad-primary-dark) 0%, #b82f10 100%) !important;
    box-shadow: 0 6px 20px 0 rgba(235, 84, 44, 0.4) !important;
    color: #fff !important;
    transform: translateY(-2px);
}

.btn-secondary {
    color: #fff;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 4px 14px 0 rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%) !important;
    box-shadow: 0 6px 20px 0 rgba(107, 114, 128, 0.4) !important;
    color: #fff !important;
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--firecad-primary);
    border: 2px solid var(--firecad-primary);
    background-color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--firecad-primary) 0%, var(--firecad-primary-dark) 100%);
    border-color: var(--firecad-primary);
    color: #fff;
    box-shadow: 0 6px 20px 0 rgba(235, 84, 44, 0.3);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 16px;
    border-radius: 14px;
}

.btn:focus, .btn:active:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(235, 84, 44, 0.2);
}

/* Page Layout */
.page-wrapper {
    width: 100%;
    min-height: 100vh;
}

.content {
    padding: 0;
}

.top-row {
    padding: 1.25rem 2rem;
}

.navbar-brand {
    font-size: 1.5rem !important;
    transition: transform 0.2s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

h1:focus {
    outline: none;
}

/* Modern Card Styles */
.card {
    background-color: #fff;
    border: 1px solid var(--firecad-border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.card-header {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-bottom: 1px solid var(--firecad-border);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    padding: 1.5rem 2rem;
}

.card-header h5 {
    margin: 0;
    color: var(--firecad-dark);
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.card-body {
    padding: 2rem;
}

/* Modern Form Styles */
.form-label {
    font-weight: 600;
    color: var(--firecad-dark);
    margin-bottom: 0.5rem;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid var(--firecad-border);
    padding: 0.875rem 1.125rem;
    font-size: 15px;
    transition: all 0.2s ease;
    background-color: #fff;
    box-shadow: var(--shadow-sm);
}

.form-control:hover, .form-select:hover {
    border-color: #d1d5db;
}

.form-control:focus, .form-select:focus {
    border-color: var(--firecad-primary);
    box-shadow: 0 0 0 4px rgba(235, 84, 44, 0.1);
    outline: none;
}

.form-control-sm {
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 14px;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--firecad-border);
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--firecad-primary);
    border-color: var(--firecad-primary);
    box-shadow: 0 0 0 3px rgba(235, 84, 44, 0.15);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(235, 84, 44, 0.2);
    border-color: var(--firecad-primary);
}

/* Modern Table Styles */
.table {
    background-color: #fff;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--firecad-dark);
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 2px solid var(--firecad-border);
    padding: 1.25rem 1rem;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.table tbody td {
    padding: 1.25rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--firecad-border);
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(235, 84, 44, 0.03);
    transform: scale(1.001);
}

.table-active {
    background: linear-gradient(90deg, rgba(235, 84, 44, 0.08) 0%, rgba(235, 84, 44, 0.04) 100%) !important;
}

.table-responsive {
    border-radius: 12px;
    overflow: hidden;
}

/* Modern Badge Styles */
.badge {
    border-radius: 8px;
    padding: 0.4rem 0.875rem;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-sm);
}

.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #fff !important;
}

.bg-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
}

/* Modern Alert Styles */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1.25rem 1.75rem;
    font-size: 15px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.btn-close {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.btn-close:hover {
    opacity: 1;
}

/* Loading Spinner */
.spinner-border {
    color: var(--firecad-primary);
}

/* Header and Title Styles */
.page-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--firecad-dark);
    margin-bottom: 0.75rem;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--firecad-dark) 0%, var(--firecad-gray) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--firecad-light-gray);
    margin-bottom: 3rem;
    font-weight: 400;
}

/* Status Icon Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert, .card {
    animation: fadeIn 0.4s ease-out;
}

/* Upload Area Enhancement */
.form-control[type="file"] {
    cursor: pointer;
    padding: 1rem;
}

.form-control[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, var(--firecad-primary) 0%, var(--firecad-primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

.form-control[type="file"]::-webkit-file-upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(235, 84, 44, 0.3);
}

/* Validation Styles */
.valid.modified:not([type=checkbox]) {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.validation-message {
    color: #ef4444;
    font-size: 13px;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Error Boundary */
.blazor-error-boundary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .btn {
        font-size: 14px;
        padding: 10px 20px;
    }

    .card-body {
        padding: 1.25rem;
    }

    .card-header {
        padding: 1.25rem 1.5rem;
    }

    .form-control, .form-select {
        font-size: 14px;
    }

    .table thead th,
    .table tbody td {
        padding: 0.875rem 0.75rem;
        font-size: 13px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Colors */
::selection {
    background-color: rgba(235, 84, 44, 0.2);
    color: var(--firecad-dark);
}

::-moz-selection {
    background-color: rgba(235, 84, 44, 0.2);
    color: var(--firecad-dark);
}
