﻿/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */

:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #06b6d4;
  --light-color: #f8fafc;
  --dark-color: #1e293b;
  --white-color: #ffffff;
  --body-bg: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition-speed: 0.3s;
  --border-radius: 0.75rem;
  --btn-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --btn-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --btn-shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --btn-radius: 0.5rem;
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
}

/* Global Styles */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Inter', 'Roboto', sans-serif;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
  background-color: #f1f5f9 !important;
  color: #1e293b !important;
  margin-bottom: 60px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary-color);
  transition: all var(--transition-speed) ease;
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 1rem;
}

.display-6 {
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Modern Card Styles */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--card-shadow-hover);
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.card-header {
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 1.25rem;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background-color: rgba(0, 0, 0, 0.03);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 1.25rem;
}

/* Button Styles */
.btn {
  border-radius: var(--btn-radius);
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  transition: var(--btn-transition);
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: var(--btn-shadow);
  border: none;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-shadow-hover);
}

.btn:active {
  transform: translateY(0);
}

.btn i {
  font-size: 1rem;
  transition: var(--btn-transition);
}

.btn:hover i {
  transform: translateY(-2px);
}

/* Button Sizes */
.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* Button Colors */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-color), #5a6268);
  color: white;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #5a6268, var(--secondary-color));
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), #218838);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #218838, var(--success-color));
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color), #c82333);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c82333, var(--danger-color));
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color), #e0a800);
  color: #212529;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #e0a800, var(--warning-color));
}

.btn-info {
  background: linear-gradient(135deg, var(--info-color), #138496);
  color: white;
}

.btn-info:hover {
  background: linear-gradient(135deg, #138496, var(--info-color));
}

/* Outline Buttons */
.btn-outline-primary {
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
}

.btn-outline-secondary {
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--secondary-color);
  color: white;
}

.btn-outline-success {
  color: var(--success-color);
  border: 2px solid var(--success-color);
  background: transparent;
}

.btn-outline-success:hover {
  background: var(--success-color);
  color: white;
}

.btn-outline-danger {
  color: var(--danger-color);
  border: 2px solid var(--danger-color);
  background: transparent;
}

.btn-outline-danger:hover {
  background: var(--danger-color);
  color: white;
}

.btn-outline-warning {
  color: var(--warning-color);
  border: 2px solid var(--warning-color);
  background: transparent;
}

.btn-outline-warning:hover {
  background: var(--warning-color);
  color: #212529;
}

.btn-outline-info {
  color: var(--info-color);
  border: 2px solid var(--info-color);
  background: transparent;
}

.btn-outline-info:hover {
  background: var(--info-color);
  color: white;
}

/* Icon Buttons */
.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
}

.btn-icon.btn-sm {
  width: 2rem;
  height: 2rem;
}

.btn-icon.btn-lg {
  width: 3rem;
  height: 3rem;
}

/* Button Groups */
.btn-group {
  box-shadow: var(--btn-shadow);
  border-radius: var(--btn-radius);
  overflow: hidden;
}

.btn-group .btn {
  box-shadow: none;
  border-radius: 0;
  margin: 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: var(--btn-radius);
  border-bottom-left-radius: var(--btn-radius);
}

.btn-group .btn:last-child {
  border-top-right-radius: var(--btn-radius);
  border-bottom-right-radius: var(--btn-radius);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.action-buttons .btn {
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
}

/* Search Button */
.search-button {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  font-weight: 600;
  height: 100%;
}

/* Disabled State */
.btn:disabled,
.btn.disabled {
  opacity: 0.65;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* Add New Button */
.btn-add {
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-add i {
  font-size: 1.1rem;
}

/* Floating Action Button */
.btn-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 1030;
}

.btn-float:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

/* Form Controls */
.form-control, .form-select {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #ced4da;
  transition: all var(--transition-speed) ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.25rem rgba(27, 110, 194, 0.25);
}

.form-floating > .form-control, .form-floating > .form-select {
  height: calc(3.5rem + 2px);
  padding: 1rem 0.75rem;
}

.form-floating > label {
  padding: 1rem 0.75rem;
}

/* Table Styles */
.table {
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 0;
}

.table thead th {
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
  font-weight: 600;
  font-size: 1rem;
  padding: 1rem;
  vertical-align: middle;
  color: #495057;
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 1rem;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.01);
}

.table-responsive {
  border-radius: var(--border-radius);
  overflow-x: auto;
  overflow-y: visible;
}

/* Table Row Styles */
.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1;
}

/* Table Cell with Icons */
.table .cell-icon {
  display: flex;
  align-items: center;
}

.table .cell-icon i {
  font-size: 1.2rem;
  margin-right: 0.75rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--light-color);
  color: var(--primary-color);
}

/* Table Badges */
.table .badge {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  font-weight: 500;
}

/* Table Actions Column */
.table td.actions {
  text-align: center;
  white-space: nowrap;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length select {
  min-width: 80px;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #ced4da;
  background-color: white;
  margin: 0 0.5rem;
}

.dataTables_wrapper .dataTables_filter input {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #ced4da;
  background-color: white;
  margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_info {
  padding: 1rem 0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 0.5rem;
  border: none !important;
  background: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
  color: var(--primary-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: var(--primary-color) !important;
  color: white !important;
}

/* Responsive Tables */
@media (max-width: 768px) {
  .table-responsive {
    border: none;
  }
  
  .table thead th {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .table tbody td {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}

/* Alert Styles */
.alert {
  border-radius: var(--border-radius);
  border: none;
  padding: 1rem 1.25rem;
}

/* Navbar styles are now only in navbar.css and _menu.cshtml - no duplicates */
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-dark);
}

/* Pagination Styles */
.pagination .page-link {
  border-radius: 0.25rem;
  margin: 0 0.125rem;
  color: var(--primary-color);
}

.pagination .page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Footer Styles */
footer, .footer {
  width: 100%;
  min-height: 56px;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding: 1rem 0 1rem 0;
  margin-top: 2rem;
}

.main-content, main {
  flex: 1 0 auto;
}

footer, .footer {
  flex-shrink: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.4rem 1rem;
  }
}

/* Login/Register Tab Control */
div.login-logout-tab div.card-header {
  padding: 0;
  border-bottom: 0;
}

div.login-logout-tab li.nav-item {
  width: 50%;
}

div.login-logout-tab a.nav-link {
  font-size: 1.25rem;
  color: var(--dark-color);
  text-align: center;
  padding: 1rem;
  border-radius: 0;
  border-bottom: 3px solid transparent;
}

div.login-logout-tab a.nav-link.active {
  color: var(--primary-color);
  background-color: transparent;
  border-bottom: 3px solid var(--primary-color);
}

/* Ярки жълти badge-ове за по-добра видимост */
.badge-yellow, .badge-warning, .bg-warning, .span-yellow {
    background: #ffc107 !important;
    color: #212529 !important;
    border: 1px solid #e0a800;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    font-weight: bold;
}

/* Жълт badge вътре в бутон – да се вижда ясно */
.btn .badge-yellow,
.btn .badge-warning,
.btn .bg-warning,
.btn .span-yellow {
    background: #ffb300 !important;
    color: #111 !important;
    border: 2px solid #b8860b;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    font-weight: bold;
    font-size: 1em;
    padding: 0.18em 0.7em;
    border-radius: 0.8em;
    margin-left: 0.5em;
    vertical-align: middle;
    display: inline-block;
    min-width: 2em;
    text-align: center;
}

/* Вариант 1: Бял badge с жълт текст и рамка */
.btn .badge-yellow.white-bg,
.btn .badge-warning.white-bg,
.btn .bg-warning.white-bg,
.btn .span-yellow.white-bg {
    background: #fff !important;
    color: #ffb300 !important;
    border: 2px solid #b8860b;
    font-weight: bold;
    font-size: 1.08em;
    padding: 0.22em 0.9em;
    border-radius: 1em;
    margin-left: 0.6em;
    vertical-align: middle;
    display: inline-block;
    min-width: 2.1em;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

/* Вариант 2: Тъмен badge с бял текст */
.btn .badge-yellow.dark-bg,
.btn .badge-warning.dark-bg,
.btn .bg-warning.dark-bg,
.btn .span-yellow.dark-bg {
    background: #1f2937 !important;
    color: #ffb300 !important;
    border: 2px solid #374151;
    font-weight: bold;
    font-size: 1.08em;
    padding: 0.22em 0.9em;
    border-radius: 1em;
    margin-left: 0.6em;
    vertical-align: middle;
    display: inline-block;
    min-width: 2.1em;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Подобрения за визуализация */
.visual-fixes {
    /* Подобрена четливост на текста */
    color: #1e293b !important;
    font-weight: 500;
    line-height: 1.6;
}

/* Подобрени бутони */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Подобрени карти */
.card {
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

/* Подобрени таблици */
.table {
    border-radius: 0.5rem;
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e2e8f0;
}

/* Подобрени форми */
.form-control {
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Подобрени навигационни елементи */
.nav-link {
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: #f1f5f9;
}

/* Подобрени алерти */
.alert {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Подобрени модали */
.modal-content {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Подобрени dropdown менюта */
.dropdown-menu {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

/* Подобрени badge-ове */
.badge {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

/* Подобрени pagination */
.pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    border: 1px solid #e2e8f0;
    color: #374151;
}

.pagination .page-item.active .page-link {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Подобрени tooltip-ове */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

/* Подобрени progress bar-ове */
.progress {
    border-radius: 0.5rem;
    height: 0.75rem;
}

.progress-bar {
    border-radius: 0.5rem;
}

/* Подобрени спинъри */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

/* Подобрени икони */
.fas, .far, .fab {
    font-weight: 900;
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands";
    display: inline-block;
    line-height: 1;
}

/* Fallback за икони ако Font Awesome не се зарежда */
.fas::before, .far::before, .fab::before {
    content: attr(data-icon);
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands";
    font-weight: 900;
}

/* Ако Font Awesome не е зареден, показваме Unicode символи */
.no-fontawesome .fas::before {
    content: "●";
    font-family: Arial, sans-serif;
}

.no-fontawesome .far::before {
    content: "○";
    font-family: Arial, sans-serif;
}

.no-fontawesome .fab::before {
    content: "■";
    font-family: Arial, sans-serif;
}

/* Подобрени hover ефекти */
.hover-lift:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* Подобрени фокуси */
.focus-ring:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Подобрени анимации */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* Подобрени responsive дизайн */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .table-responsive {
        border-radius: 0.5rem;
    }
}

.badge-pink {
    background: #e75480 !important;
    color: #fff !important;
    font-weight: bold;
    font-size: 1em;
    margin-left: 0.5em;
    border-radius: 1em;
    padding: 0.22em 0.9em;
    display: inline-block;
    vertical-align: middle;
}

.fmea-part-label {
    display: block;
    font-size: 1.25em;
    font-weight: bold;
    color: #1565c0;
    margin-bottom: 0.3em;
    letter-spacing: 0.02em;
}
.fmea-part-id {
    font-size: 1.15em;
    color: #e75480;
    margin-left: 0.3em;
}