/* css/style.css */
/* CSS Variables & Tokens for Premium Dark/Glass Design */
:root {
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Color Palette */
  --bg-main: #0B0813;
  --bg-secondary: #120e20;
  --bg-card: rgba(22, 17, 38, 0.65);
  --bg-hover: rgba(45, 37, 74, 0.4);
  
  --accent: #6d28d9;
  --accent-light: #8b5cf6;
  --accent-glow: rgba(109, 40, 217, 0.3);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --border: rgba(109, 40, 217, 0.15);
  --border-active: rgba(139, 92, 246, 0.4);
  
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Glassmorphism Specs */
  --glass-backdrop: blur(16px) saturate(180%);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Reset & Global Base styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(109, 40, 217, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 45%);
  background-attachment: fixed;
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Collapsible Glassmorphism Sidebar */
.sidebar {
  width: 78px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 14px;
  position: fixed;
  height: 100vh;
  z-index: 1000;
  box-shadow: var(--glass-shadow);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.sidebar:hover {
  width: 260px;
  padding: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  width: 100%;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-glow);
  flex-shrink: 0;
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease, max-width 0.2s ease;
}

.sidebar:hover .brand-name {
  opacity: 1;
  max-width: 200px;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  width: 100%;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  width: 100%;
  background: transparent;
}

.nav-item i {
  flex-shrink: 0;
}

.nav-item span {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease, max-width 0.2s ease, margin-left 0.2s ease;
  margin-left: 0;
}

.sidebar:hover .nav-item span {
  opacity: 1;
  max-width: 200px;
  margin-left: 12px;
}

.nav-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: rgba(109, 40, 217, 0.1);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.2), rgba(139, 92, 246, 0.05));
  color: var(--text-primary);
  border-color: var(--border-active);
  box-shadow: inset 0 0 8px rgba(109, 40, 217, 0.1);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border-active);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease, max-width 0.2s ease;
}

.sidebar:hover .user-info {
  opacity: 1;
  max-width: 200px;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Content Area */
.main-content {
  margin-left: 78px;
  flex: 1;
  padding: 40px;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar:hover ~ .main-content {
  margin-left: 260px;
}

/* Day button circular styles matching Image 5 */
.day-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.day-btn.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: white !important;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

/* Views & Pages structure */
.view-header {
  margin-bottom: 32px;
  animation: fadeIn 0.4s ease-out;
}

.view-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

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

/* Layout Grids */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card & Glass container */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.glass-card:hover {
  border-color: var(--border-active);
}

/* Stats Card */
.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
}

.stat-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(109, 40, 217, 0.1);
  color: var(--accent-light);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -1px;
}

.stat-footer {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-text, .input-select, .textarea-caption {
  width: 100%;
  background: rgba(22, 17, 38, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
  transition: all 0.25s ease;
}

.input-text:focus, .input-select:focus, .textarea-caption:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
  background: var(--bg-hover);
}

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

/* Network Selectors */
.network-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.network-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(22, 17, 38, 0.5);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.25s ease;
  user-select: none;
}

.network-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: rgba(139, 92, 246, 0.25);
}

/* Platform Branding States when Active */
.network-pill.active.instagram {
  border-color: #e1306c;
  background: rgba(225, 48, 108, 0.1);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(225, 48, 108, 0.15);
}

.network-pill.active.facebook {
  border-color: #1877f2;
  background: rgba(24, 119, 242, 0.1);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(24, 119, 242, 0.15);
}

.network-pill.active.tiktok {
  border-color: #00f2fe;
  background: rgba(0, 242, 254, 0.08);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

.network-pill.active.youtube {
  border-color: #ff0000;
  background: rgba(255, 0, 0, 0.08);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.15);
}

.network-pill.active.x {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.network-pill.active.pinterest {
  border-color: #cb141d;
  background: rgba(203, 20, 29, 0.08);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(203, 20, 29, 0.15);
}

.network-pill.active.threads {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.network-pill.active.kwai {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

/* Premium Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px var(--accent-glow);
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.5);
  filter: brightness(1.1);
}

.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

/* Custom File Uploader */
.file-uploader-box {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  background: rgba(22, 17, 38, 0.3);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.file-uploader-box:hover {
  border-color: var(--accent-light);
  background: var(--bg-hover);
}

.file-uploader-icon {
  color: var(--accent-light);
}

.file-preview {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  width: 100%;
}

.file-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Calendar Grid */
.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.calendar-weekday {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 8px 0;
}

.calendar-day-cell {
  min-height: 110px;
  background: rgba(22, 17, 38, 0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.25s ease;
}

.calendar-day-cell:hover {
  background: var(--bg-hover);
  border-color: var(--border-active);
}

.calendar-day-number {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.calendar-day-cell.today .calendar-day-number {
  color: var(--accent-light);
  font-weight: 800;
}

.calendar-day-cell.today {
  border-color: var(--accent-light);
  box-shadow: inset 0 0 10px rgba(109, 40, 217, 0.1);
}

.calendar-post-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: #fff;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  padding-right: 22px !important;
}

.btn-delete-post {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: none;
  padding: 2px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.calendar-post-badge:hover .btn-delete-post {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-delete-post:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.25);
}

.calendar-post-badge.instagram { background: rgba(225, 48, 108, 0.85); }
.calendar-post-badge.facebook { background: rgba(24, 119, 242, 0.85); }
.calendar-post-badge.tiktok { background: #000000; border: 1px solid rgba(0, 242, 254, 0.4); }
.calendar-post-badge.youtube { background: rgba(255, 0, 0, 0.85); }
.calendar-post-badge.x { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); }
.calendar-post-badge.pinterest { background: rgba(203, 20, 29, 0.85); }
.calendar-post-badge.threads { background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.2); }
.calendar-post-badge.kwai { background: rgba(245, 158, 11, 0.85); }

/* Profile layout */
.prof-connect-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.prof-connect-btn:hover {
  background: rgba(255,255,255,0.1);
}

.prof-connect-btn.connected {
  border-color: rgba(16,185,129,0.4);
  color: #10b981;
  background: rgba(16,185,129,0.1);
}

.prof-connect-btn.connected:hover {
  background: rgba(16,185,129,0.2);
}

.account-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.account-card-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.account-status.connected {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.account-status.disconnected {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-disconnect {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-disconnect:hover {
  border-color: var(--error);
  color: var(--error);
  background: rgba(239, 68, 68, 0.05);
}

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

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

/* Custom premium scrollbar for accounts list */
#accounts-facebook-list::-webkit-scrollbar,
#accounts-instagram-list::-webkit-scrollbar,
#accounts-tiktok-list::-webkit-scrollbar,
#accounts-youtube-list::-webkit-scrollbar {
  width: 5px;
}
#accounts-facebook-list::-webkit-scrollbar-track,
#accounts-instagram-list::-webkit-scrollbar-track,
#accounts-tiktok-list::-webkit-scrollbar-track,
#accounts-youtube-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
#accounts-facebook-list::-webkit-scrollbar-thumb,
#accounts-instagram-list::-webkit-scrollbar-thumb,
#accounts-tiktok-list::-webkit-scrollbar-thumb,
#accounts-youtube-list::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 4px;
}
#accounts-facebook-list::-webkit-scrollbar-thumb:hover,
#accounts-instagram-list::-webkit-scrollbar-thumb:hover,
#accounts-tiktok-list::-webkit-scrollbar-thumb:hover,
#accounts-youtube-list::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.55);
}

