/* Indian Railway Inspection Dashboard - Beatle Analytics
   Main Stylesheet */

:root {
  --primary-color: #3c8dbc;
  --secondary-color: #f8f9fa;
  --text-light: #ffffff;
  --text-dark: #333333;
}

body {
  font-family: 'Inter', 'Roboto', sans-serif;
  background-color: #f4f6f9;
  margin: 0;
  padding: 0;
}

/* Login Page Styling */
.login-page {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

/* Background Shapes */
.login-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.bg-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 6s ease-in-out infinite;
}

.shape-1 {
  width: 300px;
  height: 300px;
  top: -150px;
  right: -150px;
  animation-delay: 0s;
}

.shape-2 {
  width: 200px;
  height: 200px;
  bottom: -100px;
  left: -100px;
  animation-delay: 2s;
}

.shape-3 {
  width: 150px;
  height: 150px;
  top: 50%;
  left: -75px;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

/* Login Container */
.login-container {
  position: relative;
  z-index: 10;
}

.login-card {
  width: 500px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 60px 50px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideUp 0.8s ease-out;
}

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

/* Logo Section */
.login-logo {
  text-align: center;
  margin-bottom: 35px;
}

.logo-icon {
  display: inline-block;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary-color), #5a9bd4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  box-shadow: 0 10px 30px rgba(60, 141, 188, 0.3);
}

.logo-icon i {
  font-size: 28px;
  color: white;
}

.brand-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 10px 0 5px 0;
  background: linear-gradient(135deg, var(--primary-color), #5a9bd4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

/* Welcome Section */
.login-welcome {
  text-align: center;
  margin-bottom: 35px;
}

.login-welcome h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.login-welcome p {
  color: #6c757d;
  font-size: 14px;
  font-weight: 400;
}

/* Form Styling */
.login-form {
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 25px;
}

.form-label {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
  font-size: 14px;
}

.label-icon {
  margin-right: 8px;
  color: var(--primary-color);
  width: 16px;
}

.input-wrapper {
  position: relative;
}

.modern-input {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 16px;
  background: #f8f9fa;
  transition: all 0.3s ease;
  outline: none;
}

.modern-input:focus {
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(60, 141, 188, 0.1);
}

.input-focus-border {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.modern-input:focus + .input-focus-border {
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s ease;
}

.password-toggle:hover {
  color: var(--primary-color);
}

/* Login Button */
.btn-login {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary-color), #5a9bd4);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(60, 141, 188, 0.3);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(60, 141, 188, 0.4);
}

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

.btn-icon {
  transition: transform 0.3s ease;
}

.btn-login:hover .btn-icon {
  transform: translateX(5px);
}

/* Login Info */
.login-info {
  text-align: center;
  padding: 20px;
  background: rgba(60, 141, 188, 0.1);
  border-radius: 12px;
  margin-top: 20px;
}

.login-info p {
  margin: 0;
  font-size: 12px;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-info i {
  color: #28a745;
}

/* Login Messages */
.login-error, .login-success {
  margin-bottom: 20px;
  animation: slideDown 0.3s ease-out;
}

.login-error .alert {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.2);
  color: #721c24;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-error .alert i {
  color: #dc3545;
}

.login-success .alert {
  background: rgba(40, 167, 69, 0.1);
  border: 1px solid rgba(40, 167, 69, 0.2);
  color: #155724;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-success .alert i {
  color: #28a745;
}

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

/* Loading State for Login Button */
.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.btn-login:disabled:hover {
  transform: none !important;
}

/* Footer */
.login-footer {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 5;
}

.login-footer p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-card {
    width: 90%;
    margin: 20px;
    padding: 40px 30px;
  }
  
  .brand-name {
    font-size: 24px;
  }
  
  .login-welcome h3 {
    font-size: 20px;
  }
}

/* Dashboard Styling */
.main-header {
  background-color: var(--primary-color);
  color: var(--text-light);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar-brand {
  font-weight: 600;
}

.sidebar {
  background-color: white;
  border-right: 1px solid #dee2e6;
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  padding: 20px;
}

.content-wrapper {
  padding: 20px;
}

.card {
  margin-bottom: 20px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.card-header {
  background-color: var(--primary-color);
  color: var(--text-light);
}

.report-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.report-image-container {
  display: flex;
  flex-direction: column;
  margin: 10px 0;
}

.report-image-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.report-image-box {
  flex: 1;
  border: 1px solid #dee2e6;
  padding: 15px;
  text-align: center;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.report-image-box img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  object-position: center;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* Clickable Image Styling */
.clickable-image {
  transition: all 0.3s ease;
  position: relative;
}

.clickable-image:hover {
  transform: scale(1.02);
  border: 2px solid #007bff !important;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.clickable-image::after {
  content: '\f065';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 123, 255, 0.8);
  color: white;
  padding: 8px;
  border-radius: 50%;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.clickable-image:hover::after {
  opacity: 1;
}

.report-image-label {
  margin-top: 10px;
  font-weight: 600;
}

.quick-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

/* User Management Styles */
.users-management .table th {
  background-color: #f8f9fa;
  font-weight: 600;
  border-top: none;
}

.users-management .table td {
  vertical-align: middle;
}

.users-management .btn-group-sm .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.users-management .card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.users-management .table-responsive {
  border-radius: 0.5rem;
}

.users-management .badge {
  font-size: 0.75em;
}

/* Print Report Button Styles */
#btnPrintReport {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white !important;
  transition: all 0.3s ease;
}

#btnPrintReport:hover {
  background-color: #367fa9;
  border-color: #367fa9;
  color: white !important;
}

/* Print Styles - Optimize for printing */
@media print {
  /* General print optimizations */
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: #000 !important;
    background: white !important;
  }
  
  /* Hide non-essential elements during print */
  .navbar, .sidebar, .btn, button, .modal, .dropdown {
    display: none !important;
  }
  
  /* Report container adjustments */
  .report-container {
    width: 100% !important;
    margin: 0 !important;
    padding: 0.5in !important;
  }
  
  /* Image size control for printing */
  .report-image-box {
    width: 45% !important;
    display: inline-block !important;
    vertical-align: top !important;
    margin: 0 2% 20px 0 !important;
    page-break-inside: avoid;
  }
  
  .report-image-box img {
    width: 100% !important;
    height: 150px !important; /* Fixed smaller height for print */
    max-height: 150px !important;
    object-fit: contain !important; /* Contain instead of cover to show full image */
    border: 1px solid #ccc !important;
    margin-bottom: 5px !important;
  }
  
  /* Image row layout for print */
  .report-image-row {
    display: block !important;
    page-break-inside: avoid;
    margin-bottom: 20px !important;
  }
  
  /* Image labels */
  .report-image-label {
    font-size: 10pt !important;
    font-weight: bold !important;
    margin-bottom: 5px !important;
  }
  
  /* Remove hover effects and click indicators */
  .clickable-image::after {
    display: none !important;
  }
  
  .clickable-image {
    cursor: default !important;
  }
  
  /* Text content adjustments */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    color: #000 !important;
  }
  
  /* Table adjustments for reports */
  table {
    border-collapse: collapse !important;
    width: 100% !important;
  }
  
  table, th, td {
    border: 1px solid #000 !important;
  }
  
  th, td {
    padding: 8px !important;
    font-size: 10pt !important;
  }
  
  /* Page break control */
  .page-break {
    page-break-before: always;
  }
  
  .no-break {
    page-break-inside: avoid;
  }
  
  /* Remarks and text content */
  .text-muted {
    color: #666 !important;
  }
  
  /* Remove unnecessary spacing */
  .mt-2, .mt-3, .mb-2, .mb-3 {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
  }
}