/* public/assets/css/style.css */

:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --secondary: #10B981;
  --accent: #F59E0B;
  --background: #F8FAFC;
  --surface: #FFFFFF;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--background);
}

/* Layout Principal */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-header {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.sidebar-nav {
  list-style: none;
  padding: 0 12px;
}

.sidebar-nav li {
  margin-bottom: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  font-weight: 500;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--background);
  color: var(--text-primary);
}

.sidebar-nav .icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  opacity: 0.7;
}

.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 24px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.card-body {
  padding: 20px 24px;
}

.card-footer {
  padding: 16px 24px;
  background: var(--background);
  border-top: 1px solid var(--border-light);
}

/* Stat Cards */
.stat-card {
  text-align: center;
  padding: 24px;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  display: block;
  margin-bottom: 8px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

/* Instagram Connection Card */
.instagram-card {
  position: relative;
}

.connection-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.connected {
  background: var(--success);
}

.status-dot.disconnected {
  background: var(--text-muted);
}

.status-text {
  font-size: 14px;
  font-weight: 500;
}

.status-text.connected {
  color: var(--success);
}

.status-text.disconnected {
  color: var(--text-muted);
}

.instagram-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 18px;
}

.profile-info h4 {
  font-weight: 600;
  margin-bottom: 2px;
}

.profile-info p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--background);
  color: var(--text-primary);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-error {
  background: var(--error);
  color: white;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 24px;
  font-size: 16px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: all 0.2s ease;
  background: var(--surface);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(79 70 229 / 0.1);
}

.form-error {
  color: var(--error);
  font-size: 13px;
  margin-top: 4px;
}

/* Auth Layout */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 20px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  width: 100%;
  max-width: 400px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text-secondary);
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

.alert-success {
  background: rgb(16 185 129 / 0.1);
  color: var(--success);
  border: 1px solid rgb(16 185 129 / 0.2);
}

.alert-error {
  background: rgb(239 68 68 / 0.1);
  color: var(--error);
  border: 1px solid rgb(239 68 68 / 0.2);
}

.alert-warning {
  background: rgb(245 158 11 / 0.1);
  color: var(--warning);
  border: 1px solid rgb(245 158 11 / 0.2);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  gap: 4px;
}

.badge-success {
  background: rgb(16 185 129 / 0.1);
  color: var(--success);
}

.badge-error {
  background: rgb(239 68 68 / 0.1);
  color: var(--error);
}

.badge-warning {
  background: rgb(245 158 11 / 0.1);
  color: var(--warning);
}

.badge-primary {
  background: rgb(79 70 229 / 0.1);
  color: var(--primary);
}

/* Loading States */
.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Empty States */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  opacity: 0.3;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-description {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--background);
}

.modal-body {
  padding: 24px;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    margin: -24px -24px 24px;
  }
  
  .mobile-menu-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 16px;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .card-header,
  .card-body,
  .card-footer {
    padding: 16px;
  }
  
  .auth-card {
    padding: 24px;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .modal {
    margin: 0;
    min-height: 100vh;
    border-radius: 0;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 12px;
  }
  
  .card-header,
  .card-body,
  .card-footer {
    padding: 12px;
  }
  
  .auth-card {
    padding: 20px;
  }
  
  .sidebar {
    width: 100%;
  }
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.hidden { display: none; }
.block { display: block; }

.w-full { width: 100%; }
.h-full { height: 100%; }