/* AWS Console Style */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* AWS Console Navbar */
.aws-navbar {
  background: #232f3e;
  color: #ffffff;
  height: 48px;
  border-bottom: 1px solid #3c4043;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: none;
  padding: 0 16px;
  width: 100%;
}

/* Left Section */
.navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  min-width: 0;
}

.aws-logo {
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.logo-link:hover {
  background: #3c4043;
  text-decoration: none;
  color: #ffffff;
}

.logo-text {
  font-size: 16px;
  font-weight: 600;
}

.logo-separator {
  width: 1px;
  height: 24px;
  background: #5a6670;
  margin-left: 16px;
}

/* Services Menu */
.services-menu {
  position: relative;
}

.services-btn {
  background: none;
  border: 1px solid transparent;
  color: #ffffff;
  padding: 8px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  width: 40px;
  height: 40px;
}

.services-btn:hover {
  background: #3c4043;
  border-color: #5a6670;
  color: #0972d3;
}

.waffle-icon {
  width: 24px;
  height: 24px;
}

.dropdown-arrow {
  width: 10px;
  height: 6px;
  opacity: 0.7;
}

.services-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #232f3e;
  border: 1px solid #5a6670;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  min-width: 200px;
  display: none;
  z-index: 1001;
}

.services-menu:hover .services-dropdown {
  display: block;
}

.services-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.service-category {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.category-title {
  font-size: 12px;
  font-weight: 600;
  color: #a0a0a0;
  margin-bottom: 4px;
  padding: 8px 16px 4px 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.service-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 16px;
  transition: background-color 0.15s ease;
  display: block;
}

.service-link:hover {
  background: #3c4043;
  color: #ffffff;
  text-decoration: none;
}

/* Center Section */
.navbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  margin: 0 32px;
  min-width: 0;
}

.search-container {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 6px 40px 6px 12px;
  background: #ffffff;
  border: 1px solid #d5dbdb;
  border-radius: 4px;
  font-size: 14px;
  color: #232f3e;
}

.search-input:focus {
  outline: none;
  border-color: #0972d3;
  box-shadow: 0 0 0 2px rgba(9, 114, 211, 0.25);
}

.search-input::placeholder {
  color: #687078;
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #687078;
  cursor: pointer;
  padding: 4px;
  border-radius: 2px;
}

.search-btn:hover {
  color: #232f3e;
}

/* Right Section */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.support-link {
  position: relative;
}

.support-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffffff;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.support-btn:hover {
  background: #3c4043;
  color: #ffffff;
  text-decoration: none;
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-btn {
  background: none;
  border: 1px solid transparent;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.user-btn:hover {
  background: #3c4043;
  border-color: #5a6670;
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: #ec7211;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-name {
  font-size: 14px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #232f3e;
  border: 1px solid #5a6670;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  min-width: 200px;
  display: none;
  z-index: 1001;
}

.user-menu:hover .user-dropdown {
  display: block;
}

.user-info {
  padding: 12px 16px;
  border-bottom: 1px solid #5a6670;
  margin-bottom: 4px;
}

.user-display-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.user-email {
  font-size: 12px;
  color: #a0a0a0;
  margin-top: 2px;
}

.dropdown-item {
  display: block;
  padding: 8px 16px;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.15s ease;
}

.dropdown-item:hover {
  background: #3c4043;
  color: #ffffff;
  text-decoration: none;
}

.dropdown-divider {
  height: 1px;
  background: #5a6670;
  margin: 4px 0;
}

/* Login Section */
.login-btn {
  background: #ec7211;
  color: #ffffff;
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.login-btn:hover {
  background: #d86613;
  color: #ffffff;
  text-decoration: none;
}

/* Body padding for pages WITH navbar */
body.has-navbar {
  padding-top: 48px;
}

body {
  padding-top: 48px;
  font-family: "Amazon Ember", "Helvetica Neue", Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, #f2f3f3 0%, #e8eaed 25%, #f2f3f3 50%, #e8eaed 75%, #f2f3f3 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  color: #232f3e;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 75% 25%, rgba(236, 114, 17, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 25% 75%, rgba(9, 114, 211, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Mobile Responsive Breakpoints */

/* Tablet and large phones */
@media (max-width: 768px) {
  .navbar-container {
    padding: 0 12px; /* Reduce padding */
    gap: 8px;
  }
  
  .navbar-left {
    gap: 12px; /* Reduce gap */
  }
  
  .navbar-right {
    gap: 8px; /* Reduce gap */
  }
  
  /* Hide user name on tablets */
  .user-name {
    display: none;
  }
  
  /* Adjust services dropdown position */
  .services-dropdown {
    left: -150px; /* Move dropdown left to stay on screen */
    min-width: 300px;
  }
  
  /* Hide center section on tablets */
  .navbar-center {
    display: none;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .navbar-container {
    padding: 0 8px; /* Further reduce padding */
  }
  
  .navbar-left {
    gap: 8px;
  }
  
  .navbar-right {
    gap: 6px;
  }
  
  /* Hide logo text on small phones, keep only waffle menu */
  .logo-text {
    display: none;
  }
  
  /* Hide support text, keep only icon */
  .support-btn span {
    display: none;
  }
  
  /* Make services dropdown full-width on mobile */
  .services-dropdown {
    left: -200px;
    right: 8px;
    min-width: auto;
    max-width: calc(100vw - 16px);
  }
  
  /* Adjust user button */
  .user-btn {
    padding: 6px 8px;
  }
  
  /* Ensure avatar is properly sized */
  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .navbar-container {
    padding: 0 6px;
  }
  
  .navbar-left {
    gap: 6px;
  }
  
  .navbar-right {
    gap: 4px;
  }
  
  /* Make logo link more compact */
  .logo-link {
    padding: 6px 8px;
  }
  
  /* Make services button more compact */
  .services-btn {
    width: 36px;
    height: 36px;
    padding: 6px;
  }
  
  /* Make user button more compact */
  .user-btn {
    padding: 4px 6px;
  }
  
  .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  /* Support button more compact */
  .support-btn {
    padding: 6px 8px;
  }
}

/* Ensure dropdowns work properly on mobile */
@media (max-width: 768px) {
  /* User dropdown positioning */
  .user-dropdown {
    right: 0;
    left: auto;
    min-width: 200px;
  }
}

/* Fix for very small screens - prevent horizontal overflow */
@media (max-width: 320px) {
  .navbar-container {
    min-width: 320px; /* Ensure minimum width */
  }
  
  .services-dropdown {
    left: -180px;
    right: 4px;
  }
}

/* AWS-style Container */
.container {
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  max-width: 600px;
  width: 100%;
  margin: 40px auto;
  border: 1px solid #aab7b8;
  overflow: hidden;
}

/* AWS-style Page Header */
.page-header {
  background: transparent;
  border-bottom: none;
  padding: 20px 0;
  margin: 0;
  text-align: center;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #232f3e;
  margin: 0;
  letter-spacing: -0.5px;
}

/* Welcome Message */
.welcome-message {
  margin-bottom: 24px;
}

.welcome-message p {
  margin-bottom: 8px;
}

.welcome-message p:first-child {
  font-weight: 600;
  color: #232f3e;
  font-size: 16px;
}

/* Dashboard Actions */
.dashboard-actions {
  margin-bottom: 24px;
  padding-top: 24px;
  border-top: 1px solid #d5dbdb;
}

/* Page Content */
.page-content {
  padding: 32px;
}

/* Typography */
h1, h2, h3 {
  color: #232f3e;
  font-weight: 700;
  margin-bottom: 16px;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 24px;
  line-height: 1.3;
}

p {
  color: #687078;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* AWS-style Buttons */
.button-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.button {
  background: #ec7211;
  color: white;
  border: 1px solid #ec7211;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  font-family: inherit;
}

.button:hover {
  background: #d86613;
  border-color: #d86613;
  text-decoration: none;
}

.button:active {
  background: #bf5a11;
  border-color: #bf5a11;
}

.button.secondary {
  background: #ffffff;
  color: #232f3e;
  border: 1px solid #d5dbdb;
}

.button.secondary:hover {
  background: #f2f3f3;
  border-color: #879596;
}

.button.secondary:active {
  background: #e9ecef;
  border-color: #6c757d;
}

/* AWS-style Info Box */
.security-note {
  background: #e7f3ff;
  border: 1px solid #0972d3;
  border-radius: 4px;
  padding: 16px;
  margin-top: 24px;
  font-size: 14px;
  color: #0972d3;
  position: relative;
}

.security-note::before {
  content: "ℹ️ ";
  margin-right: 8px;
  font-size: 16px;
}

/* Error Pages - AWS Style */
.error-container {
  text-align: center;
  padding: 40px 0;
}

.error-container h1 {
  font-size: 48px;
  color: #d13212;
  margin-bottom: 16px;
  font-weight: 700;
}

.error-container h2 {
  font-size: 24px;
  color: #232f3e;
  margin-bottom: 16px;
  font-weight: 700;
}

.error-container p {
  color: #687078;
  font-size: 14px;
  margin-bottom: 24px;
}

.error-message {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  background: #f2f3f3;
  border: 1px solid #d5dbdb;
  border-radius: 4px;
  padding: 12px;
  margin: 16px 0;
  font-size: 13px;
  color: #687078;
  text-align: left;
}

code {
  background: #f2f3f3;
  border: 1px solid #d5dbdb;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 13px;
  color: #687078;
}

/* AWS-style Form Elements */
input, select, textarea {
  background: #ffffff;
  border: 1px solid #d5dbdb;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #232f3e;
  transition: border-color 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #0972d3;
  box-shadow: 0 0 0 2px rgba(9, 114, 211, 0.25);
}

/* AWS-style Table */
table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #d5dbdb;
  border-radius: 4px;
  overflow: hidden;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #d5dbdb;
  font-size: 14px;
}

th {
  background: #f2f3f3;
  font-weight: 600;
  color: #232f3e;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: #f9f9f9;
}

/* AWS-style Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.alert-success {
  background: #d4edda;
  border: 1px solid #1d8102;
  color: #1d8102;
}

.alert-error {
  background: #f8d7da;
  border: 1px solid #d13212;
  color: #d13212;
}

.alert-warning {
  background: #fff3cd;
  border: 1px solid #ff9500;
  color: #ff9500;
}

.alert-info {
  background: #e7f3ff;
  border: 1px solid #0972d3;
  color: #0972d3;
}

/* Loading Spinner - AWS Style */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #d5dbdb;
  border-radius: 50%;
  border-top-color: #0972d3;
  animation: spin 1s ease-in-out infinite;
}

/* Navbar dropdown protection against Font Awesome interference */
.navbar-dropdown .dropdown-item {
  color: #374151 !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.navbar-dropdown .dropdown-item:hover {
  color: #111827 !important;
  background-color: #f3f4f6 !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    margin: 20px;
    padding: 24px;
  }
  
  .company-name {
    font-size: 24px;
  }
  
  .button-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .button {
    width: 100%;
  }
  
  .error-container h1 {
    font-size: 36px;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 10px;
    padding: 16px;
  }
  
  .company-name {
    font-size: 20px;
  }
  
  .error-container h1 {
    font-size: 28px;
  }
}

/* ================================================== */
/* FONT AWESOME FIX - Ensures icons display properly */
/* ================================================== */

.fas, .far, .fab, .fal, .fad {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
  font-weight: 900 !important;
  -webkit-font-smoothing: antialiased;
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
}

.far {
  font-weight: 400 !important;
}

.fab {
  font-weight: 400 !important;
  font-family: "Font Awesome 6 Brands" !important;
}

/* Additional Font Awesome specific fixes */
i[class^="fa-"], i[class*=" fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure solid icons use proper weight */
.fa-solid, .fas {
  font-weight: 900 !important;
}

/* Ensure regular icons use proper weight */
.fa-regular, .far {
  font-weight: 400 !important;
}

/* Ensure brand icons use proper font family */
.fa-brands, .fab {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400 !important;
}
