/* Anitha Enterprise Portal CSS - Complete Revamp */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Styles */
.header {
  background: linear-gradient(135deg, hsl(216, 100%, 50%) 0%, hsl(216, 100%, 40%) 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  margin: 0;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: block;
}

.nav-menu a:hover,
.nav-menu a.active {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info span {
  font-weight: 500;
}

.logout-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}

.logout-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* Main Content */
.main-content {
  padding: 2rem 0;
  min-height: calc(100vh - 120px);
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  border-left: 5px solid hsl(216, 100%, 50%);
}

.page-header h1 {
  color: #333;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-header h1::before {
  content: "📊";
  font-size: 2rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.stat-card {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all 0.3s ease;
  border-left: 5px solid hsl(216, 100%, 50%);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 35px rgba(0,0,0,0.15);
}

.stat-icon {
  font-size: 3rem;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, hsl(216, 100%, 50%) 0%, hsl(216, 100%, 60%) 100%);
  color: white;
  border-radius: 50%;
  flex-shrink: 0;
}

.stat-info h3 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: #333;
}

.stat-info p {
  margin: 0;
  color: #666;
  font-size: 1rem;
  font-weight: 500;
}

/* Search Section */
.search-section {
  display: flex;
  gap: 1.5rem;
  margin: 2rem 0;
  align-items: end;
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.search-bar {
  flex: 1;
  display: flex;
  gap: 1rem;
}

.search-bar input {
  flex: 1;
  padding: 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.search-bar input:focus {
  outline: none;
  border-color: hsl(216, 100%, 50%);
}

.filter-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-controls select,
.filter-controls input {
  padding: 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-size: 1rem;
  min-width: 150px;
}

/* Table Styles */
.table-container {
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.1);
  overflow: hidden;
  margin: 2rem 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 1.5rem 1rem;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.data-table th {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  font-weight: 600;
  color: #333;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tr:hover {
  background: #f8f9fa;
  transition: background 0.2s ease;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Button Styles */
.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, hsl(216, 100%, 50%) 0%, hsl(216, 100%, 60%) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(0,123,255,0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,123,255,0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(108,117,125,0.3);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(108,117,125,0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(220,53,69,0.3);
}

.btn-danger:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(220,53,69,0.4);
}

.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(40,167,69,0.3);
}

.btn-success:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(40,167,69,0.4);
}

.btn-small {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
}

.btn i {
  font-size: 1.2rem;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  margin: 3% auto;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.large-modal .modal-content {
  width: 95%;
  max-width: 1200px;
  height: 95vh;
}

.modal-header {
  padding: 2rem;
  border-bottom: 2px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 20px 20px 0 0;
}

.modal-header h2 {
  margin: 0;
  color: #333;
  font-size: 1.8rem;
  font-weight: 700;
}

.modal-body {
  padding: 3rem;
}

.modal-actions {
  padding: 2rem;
  border-top: 2px solid #f0f0f0;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  background: #f8f9fa;
  border-radius: 0 0 20px 20px;
}

.close {
  color: #aaa;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
}

.close:hover {
  color: #333;
}

/* Form Styles */
.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: hsl(216, 100%, 50%);
  box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

/* Invoice Form Specific Styles */
.invoice-form-header {
  display: grid;
  gap: 2rem;
  margin-bottom: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 15px;
  border-left: 5px solid hsl(216, 100%, 50%);
}

.customer-info-display {
  padding: 1.5rem;
  background: white;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-size: 1rem;
  color: #666;
  min-height: 80px;
}

.invoice-items-section {
  margin: 3rem 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #eee;
}

.section-header h3 {
  color: #333;
  font-size: 1.5rem;
  margin: 0;
}

.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.invoice-items-table th,
.invoice-items-table td {
  padding: 1rem;
  border: 1px solid #f0f0f0;
  text-align: left;
}

.invoice-items-table th {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.invoice-items-table input,
.invoice-items-table select {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #e1e5e9;
  background: white;
  font-size: 0.9rem;
  border-radius: 6px;
}

.invoice-items-table input:focus,
.invoice-items-table select:focus {
  outline: none;
  border-color: hsl(216, 100%, 50%);
}

.invoice-totals {
  margin: 3rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 15px;
  border-left: 5px solid #28a745;
}

.totals-section {
  max-width: 600px;
  margin-left: auto;
}

.total-amount {
  font-size: 1.5rem;
  font-weight: bold;
  color: hsl(216, 100%, 50%);
  padding: 1rem;
  background: white;
  border-radius: 10px;
  text-align: center;
  margin-top: 1rem;
}

/* Invoice Preview Styles */
.invoice-preview {
  background: white;
  padding: 3rem;
  font-family: Arial, sans-serif;
}

.invoice-document {
  max-width: 800px;
  margin: 0 auto;
  border: 2px solid #ddd;
  padding: 3rem;
  border-radius: 10px;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3rem;
  border-bottom: 3px solid #333;
  padding-bottom: 2rem;
}

.company-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.company-logo .logo-text {
  width: 80px;
  height: 80px;
  background: #333;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  border-radius: 10px;
}

.company-details h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: bold;
  color: #333;
}

.company-details p {
  margin: 0.5rem 0;
  font-size: 1rem;
  color: #666;
}

.invoice-details {
  text-align: right;
}

.cash-bill-header {
  background: #333;
  color: white;
  padding: 1rem 2rem;
  margin-bottom: 1rem;
  border-radius: 10px;
}

.cash-bill-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.invoice-meta p {
  margin: 0.5rem 0;
  font-weight: bold;
  font-size: 1rem;
}

.invoice-number {
  color: red;
  font-size: 1.3rem;
  font-weight: bold;
}

.customer-section {
  margin: 2rem 0;
}

.customer-info {
  border: 2px solid #333;
  padding: 2rem;
  min-height: 120px;
  border-radius: 10px;
}

.invoice-table {
  margin: 2rem 0;
}

.invoice-table table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid #333;
}

.invoice-table th,
.invoice-table td {
  border: 1px solid #333;
  padding: 1rem;
  text-align: center;
}

.invoice-table th {
  background: #f0f0f0;
  font-weight: bold;
}

.invoice-table td:nth-child(2) {
  text-align: left;
}

.preview-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
}

/* Status Badges */
.status-badge {
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.status-shipped {
  background: #d4edda;
  color: #155724;
}

.status-delivered {
  background: #cce5ff;
  color: #004085;
}

.status-draft {
  background: #e2e3e5;
  color: #383d41;
}

.status-sent {
  background: #d1ecf1;
  color: #0c5460;
}

.status-paid {
  background: #d4edda;
  color: #155724;
}

.status-overdue {
  background: #f8d7da;
  color: #721c24;
}

.status-cancelled {
  background: #f5c6cb;
  color: #721c24;
}

/* Login Page */
.login-container {
  max-width: 450px;
  margin: 5rem auto;
  background: white;
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.login-form h2 {
  text-align: center;
  color: hsl(216, 100%, 50%);
  margin-bottom: 3rem;
  font-size: 2.5rem;
  font-weight: 700;
}

.login-container .form-group input {
  padding: 1.2rem;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-size: 1.1rem;
}

.login-container .btn {
  width: 100%;
  padding: 1.2rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.error-message {
  background: #fee;
  color: #c33;
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  border-left: 5px solid #c33;
  font-weight: 500;
}

/* Dashboard Specific */
.welcome-section {
  background: white;
  padding: 4rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  text-align: center;
  margin-bottom: 3rem;
  border-top: 5px solid hsl(216, 100%, 50%);
}

.welcome-section h1 {
  color: hsl(216, 100%, 50%);
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.welcome-section p {
  color: #666;
  font-size: 1.3rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.dashboard-card {
  background: white;
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  border-left: 5px solid hsl(216, 100%, 50%);
}

.dashboard-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.dashboard-card .icon {
  font-size: 4rem;
  margin-bottom: 2rem;
  color: hsl(216, 100%, 50%);
}

.dashboard-card h3 {
  color: #333;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.dashboard-card p {
  color: #666;
  font-size: 1rem;
  line-height: 1.6;
}

.dashboard-card a {
  text-decoration: none;
  color: inherit;
}

/* Utility Classes */
.no-data {
  text-align: center;
  padding: 4rem;
  color: #666;
  background: white;
  border-radius: 20px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.no-data h3 {
  color: #333;
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.no-data p {
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: hsl(216, 100%, 50%);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: #666;
}

.btn-icon:hover {
  background: #f0f0f0;
  color: #333;
}

.btn-icon.delete:hover {
  background: #ffe6e6;
  color: #dc3545;
}

/* Loading Animation */
.loading {
  border: 4px solid #f3f3f3;
  border-top: 4px solid hsl(216, 100%, 50%);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .container {
    padding: 0 15px;
  }
  
  .modal-content {
    width: 95%;
    margin: 2% auto;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    text-align: center;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .search-section {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .table-container {
    overflow-x: auto;
  }

  .data-table {
    min-width: 600px;
  }

  .form-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal-body {
    padding: 2rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }

  .welcome-section {
    padding: 2rem;
  }

  .welcome-section h1 {
    font-size: 2rem;
  }

  .dashboard-card {
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  .login-container {
    margin: 2rem auto;
    padding: 2rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .modal-content {
    width: 98%;
    margin: 1% auto;
    border-radius: 15px;
  }

  .modal-header,
  .modal-body {
    padding: 1.5rem;
  }
}

/* Print Styles */
@media print {
  .invoice-preview {
    padding: 0;
  }
  
  .modal-header,
  .modal-actions,
  .preview-actions,
  .header,
  .search-section,
  .page-header {
    display: none !important;
  }
  
  .modal-content {
    box-shadow: none;
    margin: 0;
    width: 100%;
    max-width: none;
  }
}
