/* Reset i podstawowe style */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Animacje fade-in */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Loading animations */
@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

/* Header & Navigation styles moved to header.css */

.nav-link.active .nav-badge {
  background: rgba(255, 255, 255, 0.2);
}

/* Główna treść */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 0;
  padding-bottom: 160px;
}

/* Sekcja powitalna */
.welcome-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px;
  border-radius: 16px;
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.welcome-section::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(50px, -50px);
  animation: pulse 4s ease-in-out infinite;
}

.welcome-content {
  flex: 1;
  z-index: 2;
}

.welcome-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.welcome-subtitle {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 16px;
}

.welcome-actions {
  flex-shrink: 0;
  z-index: 2;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: white;
  color: #667eea;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Grid metryki */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.metric-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #f1f5f9;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.metric-card:nth-child(1) {
  animation: scaleIn 0.6s ease-out 0.4s both;
}
.metric-card:nth-child(2) {
  animation: scaleIn 0.6s ease-out 0.5s both;
}
.metric-card:nth-child(3) {
  animation: scaleIn 0.6s ease-out 0.6s both;
}
.metric-card:nth-child(4) {
  animation: scaleIn 0.6s ease-out 0.7s both;
}

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

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.metric-icon.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.metric-icon.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.metric-icon.info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
}

.metric-icon.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.metric-content {
  margin-bottom: 16px;
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
  transition: all 0.3s ease;
}

.metric-label {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

/* Loading states */
.loading .metric-value {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  color: transparent;
  border-radius: 4px;
  width: 80px;
  height: 40px;
  display: flex;
  align-items: center;
}

.loading .metric-label {
  animation: pulse 1.5s ease-in-out infinite;
  opacity: 0.6;
}

.loading .metric-icon {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Loading indicator */
.loading-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  margin-top: 16px;
  color: #64748b;
  animation: fadeInUp 0.5s ease-out;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .welcome-section {
    flex-direction: column;
    text-align: center;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .header-content {
    padding: 0 16px;
  }

  .main-content {
    padding: 24px 16px 0;
  }

  /* Responsive navigation */
  .nav-content {
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .nav-content::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }

  .nav-text {
    display: none;
  }

  .nav-icon {
    font-size: 18px;
  }
}

@media (max-width: 1200px) {
  /* Medium screens - slightly smaller navigation */
  .nav-content {
    gap: 4px;
  }

  .nav-link {
    padding: 10px 12px;
    font-size: 13px;
  }
}

@media (max-width: 900px) {
  /* Compact navigation for smaller screens */
  .nav-link .nav-text {
    font-size: 12px;
  }

  .nav-link {
    padding: 8px 10px;
  }
}

/* Dodatkowe animacje dla interakcji */
.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(102, 126, 234, 0.1),
    transparent
  );
  transition: left 0.6s;
}

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

/* Dodatkowe style dla badge'ów */
.nav-badge.loading {
  background: #e2e8f0;
  color: #64748b;
  animation: pulse 1.5s ease-in-out infinite;
}

/* SMS Addon Functionality */
.metric-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 14px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* 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.5);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  border-radius: 16px;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close {
  font-size: 28px;
  font-weight: bold;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close:hover {
  color: #475569;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px 24px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* SMS Addon Package */
.addon-info {
  margin-bottom: 24px;
}

.addon-package {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s ease;
}

.addon-package:hover {
  border-color: #3b82f6;
}

.package-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.package-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: 10px;
}

.package-details h4 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.package-price {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #3b82f6;
}

.package-features {
  margin-bottom: 12px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #475569;
}

.monthly-usage {
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
  color: #64748b;
}

/* SMS Status Modal */
.sms-stats {
  margin-bottom: 20px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.stat-label {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.stat-value {
  font-size: 14px;
  color: #1e293b;
  font-weight: 600;
}

/* Addon History */
.addon-list {
  max-height: 200px;
  overflow-y: auto;
}

.addon-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  gap: 12px;
}

.addon-amount {
  font-weight: 600;
  color: #3b82f6;
}

.addon-used {
  color: #64748b;
}

.addon-price {
  font-weight: 600;
  color: #059669;
}

.addon-date {
  color: #64748b;
  font-size: 12px;
}

.no-addons {
  text-align: center;
  color: #64748b;
  font-style: italic;
  padding: 20px;
}

/* Responsive */
@media (max-width: 640px) {
  .modal-content {
    width: 95%;
    margin: 20px;
  }

  .addon-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .stat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
/* User Dropdown Styles */
.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 200px;
}

.user-dropdown.show {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 12px 20px;
  color: #333;
  text-decoration: none;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: #f5f5f5;
}

.dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
  border-top: 1px solid #eee;
  border-radius: 0 0 8px 8px;
}

.dropdown-arrow {
  margin-left: 5px;
  font-size: 10px;
}

.user-profile {
  cursor: pointer;
  display: flex;
  align-items: center;
}

.user-menu {
  position: relative;
}
