/* ==================== VARIABLES & RESET ==================== */
:root {
  --primary-color: #00d4ff;
  --secondary-color: #ff6b6b;
  --success-color: #51cf66;
  --warning-color: #ffa94d;
  --danger-color: #ff6b6b;
  --dark-bg: #0f2027;
  --darker-bg: #203a43;
  --darkest-bg: #2c5364;
  --glass-light: rgba(255, 255, 255, 0.05);
  --glass-lighter: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: #b8c5d6;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 50%, var(--darkest-bg) 100%);
  position: relative;
}

/* ==================== BACKGROUND ==================== */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 50%, var(--darkest-bg) 100%);
  pointer-events: none;
  z-index: 0;
}

/* ==================== CONTAINER & LAYOUT ==================== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
}

main {
  animation: fadeIn 0.6s ease-out;
}

/* ==================== HEADER ==================== */
.header {
  margin-bottom: 60px;
  animation: slideDown 0.8s ease-out;
}

.header-content {
  background: linear-gradient(135deg, var(--glass-light) 0%, var(--glass-lighter) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.header-title {
  flex: 1;
  min-width: 300px;
  text-align: left;
}

.header-actions {
  display: flex;
  gap: 15px;
}

.title {
  font-size: 2.5em;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #00d4ff 0%, #7b2ff7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  text-align: left;
}

.title i {
  margin-right: 15px;
  animation: float 3s ease-in-out infinite;
}

.subtitle {
  font-size: 1em;
  color: var(--text-secondary);
  font-weight: 300;
  text-align: left;
  margin-left: 78px;
}

/* ==================== SECTIONS ==================== */
.section-title {
  font-size: 2em;
  margin-bottom: 30px;
  text-align: center;
  color: var(--text-primary);
  font-weight: 600;
}

.provider-section {
  margin-bottom: 80px;
}

/* ==================== PROVIDER CARDS ==================== */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.provider-card {
  background: linear-gradient(135deg, var(--glass-light) 0%, var(--glass-lighter) 100%);
  backdrop-filter: blur(10px);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 35px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.provider-card:hover {
  transform: translateY(-10px);
  border-color: currentColor;
  box-shadow: var(--shadow-lg);
}

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

.provider-card:hover::before {
  left: 100%;
}

.provider-icon {
  font-size: 3.5em;
  margin-bottom: 15px;
  animation: bounce 2s ease-in-out infinite;
}

.provider-name {
  font-size: 1.6em;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.provider-status {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(255, 107, 107, 0.2);
  border: 1px solid rgba(255, 107, 107, 0.5);
  border-radius: 20px;
  font-size: 0.85em;
  color: #ff8b8b;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.provider-status.connected {
  background: rgba(81, 207, 102, 0.2);
  border-color: rgba(81, 207, 102, 0.5);
  color: #51cf66;
}

.provider-status i {
  margin-right: 6px;
}

.provider-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.provider-buttons .btn {
  flex: 1;
}

/* ==================== BUTTONS ==================== */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn i {
  font-size: 1em;
}

.btn-primary {
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

.btn-small {
  padding: 8px 16px;
  font-size: 0.85em;
}

.btn-full {
  width: 100%;
  margin-top: 20px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1em;
}

.btn-danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #cc0000 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

/* ==================== DASHBOARD SECTION ==================== */
.dashboard-section {
  animation: fadeIn 0.6s ease-out;
}

.dashboard-section.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

/* ==================== STATS GRID ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 25px;
  border-radius: 16px;
  text-align: center;
  animation: slideUp 0.6s ease-out;
}

.stat-icon {
  font-size: 2.5em;
  margin-bottom: 12px;
  animation: bounce 2s ease-in-out infinite;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.85em;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.stat-value {
  font-size: 2em;
  font-weight: 800;
  background: linear-gradient(135deg, #00d4ff 0%, #7b2ff7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==================== GLASS CARD ==================== */
.glass-card {
  background: linear-gradient(135deg, var(--glass-light) 0%, var(--glass-lighter) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* ==================== FEATURE SECTIONS (Full Width, Stacked) ==================== */
.feature-section {
  padding: 35px;
  margin-bottom: 30px;
  border-radius: 16px;
  animation: slideUp 0.6s ease-out;
  width: 100%;
}

.feature-title {
  font-size: 1.6em;
  margin-bottom: 20px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-content {
  width: 100%;
}

.feature-description {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin-top: 15px;
  font-style: italic;
}

.feature-section canvas {
  max-width: 100%;
  height: auto;
  margin-bottom: 15px;
}

/* ==================== SAVINGS CALCULATOR ==================== */
.savings-calculator-content {
  width: 100%;
}

.slider-container {
  margin: 30px 0;
  width: 100%;
}

.savings-slider {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: rgba(57, 255, 20, 0.1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin-bottom: 15px;
}

.savings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #39ff14 0%, #00ff41 100%);
  cursor: pointer;
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
  border: 2px solid var(--text-primary);
}

.savings-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #39ff14 0%, #00ff41 100%);
  cursor: pointer;
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
  border: 2px solid var(--text-primary);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.85em;
  font-weight: 600;
}

.savings-text {
  text-align: center;
  font-size: 1.3em;
  font-weight: 700;
  color: #39ff14;
  margin-top: 15px;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

/* ==================== METRICS DISPLAY ==================== */
.metrics-display {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 500;
}

.metric-item:last-child {
  border-bottom: none;
}

.metric-label {
  color: var(--text-secondary);
  font-size: 0.95em;
}

.metric-value {
  color: var(--primary-color);
  font-size: 1.3em;
  font-weight: 700;
}

/* ==================== CHART CONTAINER ==================== */
.chart-container {
  max-width: 100%;
  height: auto;
}

#savingsChart,
#awsCostChart,
#gcpTimelineChart,
#azureVMChart {
  max-width: 100%;
  height: auto;
}

/* ==================== TABLE CONTAINER ==================== */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.table-title {
  margin: 0;
  font-size: 1.6em;
  font-weight: 700;
}

.table-scroll {
  overflow-x: auto;
  border-radius: 12px;
  width: 100%;
}

.resources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.resources-table thead {
  background: rgba(0, 212, 255, 0.05);
}

.resources-table th {
  padding: 16px;
  text-align: left;
  font-weight: 700;
  color: var(--primary-color);
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.8em;
  letter-spacing: 1px;
}

.resources-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.resources-table tbody tr {
  transition: all 0.3s ease;
}

.resources-table tbody tr:hover {
  background: rgba(0, 212, 255, 0.05);
  border-left: 3px solid var(--primary-color);
}

.resources-table tbody tr.removed {
  opacity: 0;
  animation: slideOut 0.4s ease-out;
}

.resource-name {
  font-weight: 600;
  color: var(--text-primary);
}

.resource-cost {
  font-weight: 700;
  color: var(--danger-color);
}

.severity-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.severity-critical {
  background: rgba(255, 107, 107, 0.2);
  border: 1px solid rgba(255, 107, 107, 0.5);
  color: #ff8b8b;
}

.severity-high {
  background: rgba(255, 165, 0, 0.2);
  border: 1px solid rgba(255, 165, 0, 0.5);
  color: #ffb347;
}

.severity-medium {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.5);
  color: #ffd54f;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.action-buttons .btn {
  padding: 8px 12px;
  font-size: 0.8em;
}

/* ==================== MODAL ==================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  animation: slideUp 0.4s ease-out;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2em;
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modal-close:hover {
  color: var(--danger-color);
  transform: rotate(90deg);
}

.modal-header {
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.modal-header h2 {
  font-size: 1.8em;
  color: var(--text-primary);
}

.modal-body {
  margin-bottom: 30px;
}

.modal-section {
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
}

.modal-section:last-child {
  border-bottom: none;
}

.modal-section h4 {
  font-size: 1.1em;
  margin-bottom: 15px;
  color: var(--primary-color);
  font-weight: 700;
}

.modal-section p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-section strong {
  color: var(--text-primary);
}

.modal-section pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  overflow-x: auto;
  font-size: 0.85em;
  color: var(--primary-color);
  font-family: 'Courier New', monospace;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: linear-gradient(135deg, var(--glass-light) 0%, var(--glass-lighter) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 12px;
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  pointer-events: all;
  animation: slideInRight 0.4s ease-out;
  min-width: 280px;
}

.toast.success {
  border-left: 4px solid var(--success-color);
}

.toast.success::before {
  content: '✓';
  font-size: 1.3em;
  color: var(--success-color);
}

.toast.error {
  border-left: 4px solid var(--danger-color);
}

.toast.error::before {
  content: '✕';
  font-size: 1.3em;
  color: var(--danger-color);
}

.toast.info {
  border-left: 4px solid var(--primary-color);
}

.toast.info::before {
  content: 'ℹ';
  font-size: 1.3em;
  color: var(--primary-color);
}

/* ==================== LOADING SPINNER ==================== */
.spinner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
}

.spinner.hidden {
  display: none;
}

.spinner-content {
  text-align: center;
}

.spinner-circle {
  width: 60px;
  height: 60px;
  border: 4px solid var(--glass-lighter);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

.spinner-content p {
  color: var(--text-primary);
  font-size: 1.2em;
  font-weight: 600;
}

/* ==================== FEATURE 3: CONFETTI ==================== */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
}

.confetti-success-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3em;
  font-weight: 800;
  color: #39ff14;
  text-shadow: 0 0 30px rgba(57, 255, 20, 0.6);
  z-index: 10000;
  animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.confetti-success-message.hidden {
  display: none;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

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

@keyframes popIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes confettiFall {
  to {
    transform: translateY(100vh) rotateZ(360deg);
    opacity: 0;
  }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .container {
    padding: 20px 15px;
  }

  .title {
    font-size: 1.8em;
  }

  .header-content {
    flex-direction: column;
    padding: 25px;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .feature-section {
    padding: 25px;
  }

  .feature-title {
    font-size: 1.3em;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .modal-content {
    padding: 25px;
  }

  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-header .btn {
    width: 100%;
  }

  .resources-table {
    font-size: 0.8em;
  }

  .resources-table th,
  .resources-table td {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 1.3em;
  }

  .section-title {
    font-size: 1.3em;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-value {
    font-size: 1.5em;
  }

  .feature-section {
    padding: 15px;
  }

  .feature-title {
    font-size: 1.1em;
  }

  .modal-content {
    padding: 15px;
  }

  .confetti-success-message {
    font-size: 2em;
  }
}

