/**
 * Custom CSS Styles
 * Tonsoft Stok Takip Sistemi
 */

@font-face {
  font-family: "Signatra";
  src: url("../../Signatra.otf") format("opentype"),
    url("../../Signatra.ttf") format("truetype");
  font-display: swap;
}

:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
}

/* Global Styles */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  background-color: #f8f9fa;
}

.content-wrapper {
  padding: 20px 0;
  min-height: calc(100vh - 150px);
}

/* Navbar */
.navbar-brand {
  font-family: "Signatra", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 400;
  font-size: 1.7rem;
  color: #fff;
  line-height: 1;
}

.navbar-brand:hover,
.navbar-brand:focus {
  color: #fff;
}

/* Sidebar */
#sidebar {
  min-height: calc(100vh - 56px);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link {
  color: #333;
  padding: 10px 15px;
  margin: 2px 0;
  border-radius: 5px;
  transition: all 0.3s;
}

.sidebar .nav-link:hover {
  background-color: #e9ecef;
  color: var(--primary-color);
}

.sidebar .nav-link.active {
  background-color: var(--primary-color);
  color: white;
}

.sidebar .nav-link i {
  width: 20px;
  margin-right: 10px;
}

/* Cards */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.card-header {
  background-color: white;
  border-bottom: 2px solid #f0f0f0;
  font-weight: 600;
}

/* Buttons */
.btn {
  border-radius: 5px;
  padding: 8px 20px;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Tables */
.table {
  background-color: white;
}

.table thead th {
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: #666;
}

.table-hover tbody tr:hover {
  background-color: #f8f9fa;
}

/* Badges */
.badge {
  padding: 5px 10px;
  font-weight: 500;
  border-radius: 4px;
}

/* Forms */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
  font-weight: 500;
  margin-bottom: 5px;
  color: #333;
}

/* Alerts */
.alert {
  border-radius: 8px;
  border: none;
}

.alert i {
  margin-right: 8px;
}

/* Footer */
.footer {
  background-color: white;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
}

/* Loading Spinner */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner-overlay.show {
  display: flex;
}

.spinner-border-lg {
  width: 3rem;
  height: 3rem;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length select {
  padding: 5px;
  border-radius: 4px;
}

.dataTables_wrapper .dataTables_filter input {
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid #ced4da;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 5px 10px;
  margin: 0 2px;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 56px;
    left: -100%;
    width: 250px;
    height: 100%;
    transition: left 0.3s;
    z-index: 1000;
    background-color: white;
  }

  #sidebar.show {
    left: 0;
  }

  .content-wrapper {
    margin-left: 0 !important;
  }
}

/* Utility Classes */
.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.shadow-sm {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08) !important;
}

.cursor-pointer {
  cursor: pointer;
}

/* Print Styles */
@media print {
  .sidebar,
  .navbar,
  .footer,
  .btn-toolbar,
  .no-print {
    display: none !important;
  }

  .content-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
  }
}

/* Global Search Styles */
.input-group {
  position: relative;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 5px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-height: 500px;
  overflow-y: auto;
  z-index: 1050;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-results-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e3e6f0;
  background-color: #f8f9fc;
  font-size: 0.9rem;
  color: #666;
  border-radius: 8px 8px 0 0;
}

.search-results-list {
  max-height: 450px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e3e6f0;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.search-result-item:hover {
  background-color: #f8f9fc;
  padding-left: 20px;
}

.search-result-item:last-child {
  border-bottom: none;
  border-radius: 0 0 8px 8px;
}

.search-result-main {
  flex: 1;
}

.search-result-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.search-result-name mark {
  background-color: #fff3cd;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 700;
}

.search-result-details {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
}

.search-result-details .badge {
  font-size: 0.75rem;
}

.search-result-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: 16px;
}

.search-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.search-price {
  font-weight: 600;
  color: var(--success-color);
  font-size: 0.95rem;
}

.search-no-results {
  padding: 40px 20px;
  text-align: center;
  color: #999;
}

.search-no-results i {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

.search-no-results p {
  margin: 0;
  font-size: 0.95rem;
}

/* Search Input Focus */
#global-search-input:focus {
  border-color: white;
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

/* Scrollbar Styling for Search Results */
.search-results::-webkit-scrollbar {
  width: 8px;
}

.search-results::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 0 8px 8px 0;
}

.search-results::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Mobile Responsive Search */
@media (max-width: 768px) {
  .d-flex.mx-auto {
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px 0 !important;
  }

  .search-results {
    max-height: 300px;
  }

  .search-result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .search-result-meta {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    margin-left: 0;
  }
}

/* ========================================
   Login Page Styles
   ======================================== */

.login-page body {
  background: #f8f9fa;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

/* Animated Background Waves */
.login-page body::before {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(52, 73, 94, 0.03) 1px,
    transparent 1px
  );
  background-size: 40px 40px;
  animation: backgroundMove 25s linear infinite;
  opacity: 0.6;
}

@keyframes backgroundMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

/* Floating Shapes */
.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.06;
  animation: float 15s infinite ease-in-out;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: #3498db;
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 200px;
  height: 200px;
  background: #2c3e50;
  bottom: -50px;
  right: -50px;
  animation-delay: 3s;
}

.shape-3 {
  width: 150px;
  height: 150px;
  background: #3498db;
  top: 50%;
  left: 10%;
  animation-delay: 6s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-30px) rotate(120deg);
  }
  66% {
    transform: translateY(30px) rotate(240deg);
  }
}

.login-wrapper {
  width: 100%;
  max-width: 450px;
  padding: 20px;
  position: relative;
  z-index: 10;
  margin: 0 auto;
}

.login-card {
  background: #ffffff;
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  animation: slideUp 0.6s ease-out;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

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

.login-header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 40px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.08) 10%,
    transparent 50%
  );
  animation: headerPulse 8s infinite;
}

@keyframes headerPulse {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(10%, 10%) scale(1.1);
  }
}

.login-header i {
  font-size: 3.5rem;
  margin-bottom: 15px;
  animation: iconBounce 2s infinite;
  position: relative;
  z-index: 1;
}

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

.login-header h2 {
  position: relative;
  z-index: 1;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.login-header p {
  position: relative;
  z-index: 1;
  opacity: 0.9;
}

.login-body {
  padding: 40px;
  position: relative;
}

.login-body h4 {
  color: #333;
  font-weight: 700;
  margin-bottom: 30px;
}

.login-page .form-label {
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}

.login-page .form-label i {
  color: #3498db;
  margin-right: 5px;
}

.login-page .form-control {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 16px;
  transition: all 0.3s ease;
  font-size: 1rem;
  background-color: #fafafa;
}

.login-page .form-control:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.1);
  transform: translateY(-1px);
  background-color: #fff;
}

.login-page .form-control:hover {
  border-color: #bdc3c7;
  background-color: #fff;
}

.login-page .input-group {
  border-radius: 10px;
  overflow: hidden;
}

.login-page .input-group .form-control {
  border-right: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.login-page .input-group .btn-outline-secondary {
  border: 1px solid #ddd;
  border-left: none;
  background: #fafafa;
  color: #3498db;
  transition: all 0.3s ease;
}

.login-page .input-group .btn-outline-secondary:hover {
  background: #3498db;
  color: #fff;
}

.login-page .form-check-input:checked {
  background-color: #3498db;
  border-color: #3498db;
}

.login-page .form-check-label {
  color: #666;
  cursor: pointer;
  transition: color 0.2s ease;
}

.login-page .form-check-label:hover {
  color: #333;
}

.btn-login {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  border: none;
  padding: 14px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(52, 152, 219, 0.3);
}

.btn-login:active {
  transform: translateY(-1px);
}

.login-page .alert {
  border-radius: 10px;
  border: none;
  padding: 15px;
  animation: alertSlide 0.4s ease-out;
}

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

.login-page hr {
  margin: 30px 0;
  opacity: 0.2;
}

.login-page .text-muted {
  color: #888 !important;
}

.login-page .text-muted strong {
  color: #3498db;
}

/* Responsive Design for Login */
@media (max-width: 576px) {
  .login-wrapper {
    padding: 10px;
  }

  .login-body {
    padding: 30px 20px;
  }

  .login-header {
    padding: 30px 20px;
  }

  .login-header i {
    font-size: 2.5rem;
  }
}
