/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

.logo {
    font-size: 3rem;
    font-weight: 300;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    font-weight: 300;
}

/* Section d'authentification */
.auth-section {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.login-form h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.auth-info {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-top: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.user-info span {
    color: #333;
    font-weight: 500;
}

.input-note {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
    display: block;
}

/* Main content */
.main-content {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .add-feed-section {
        grid-column: 1 / -1;
    }
}

/* Sections */
section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

section h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* En-tête de section avec bouton */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    margin-bottom: 0;
    flex: 1;
}

/* Formulaire RSS */
.rss-form {
    width: 100%;
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-primary {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

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

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

.btn-secondary {
    padding: 12px 24px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary.processing {
    background: #28a745;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
}

.btn-secondary.processing .btn-text {
    display: none;
}

.btn-secondary.processing .btn-loading {
    display: inline;
}

/* Bouton de suppression */
.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Messages de validation */
.validation-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 10px;
    display: none;
}

.validation-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.validation-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Boîte d'information */
.info-box {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #1565c0;
}

.info-box p {
    margin: 0;
    line-height: 1.5;
}

/* Liste des flux */
.feeds-list, .reports-list {
    min-height: 200px;
}

.feed-item, .report-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.feed-item:hover, .report-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.feed-url {
    font-size: 0.9rem;
    color: #666;
    word-break: break-all;
    margin-bottom: 10px;
}

.feed-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    float: right;
    transition: background 0.3s ease;
}

.btn-remove:hover {
    background: #c82333;
}

/* Comptes-rendus */
.report-item {
    border-left-color: #28a745;
}

.report-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.report-content {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.report-meta {
    font-size: 0.85rem;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* État vide */
.empty-state {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 40px 20px;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Section de planification */
.scheduler-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.scheduler-section h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.5rem;
}

.scheduler-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 500;
    color: #555;
}

.form-group select,
.form-group input[type="time"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.form-group select:focus,
.form-group input[type="time"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.scheduler-status {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #6c757d;
}

.scheduler-status.active {
    background: #d4edda;
    border-left-color: #28a745;
}

#scheduler-status-text {
    font-weight: 500;
    color: #333;
}

#next-execution {
    display: block;
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
}

/* Section des paramètres */
.settings-section {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.settings-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 600;
}

.settings-form {
    display: grid;
    gap: 20px;
}

.settings-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-form label {
    font-weight: 500;
    color: #555;
    font-size: 0.95rem;
}

.settings-form input[type="email"],
.settings-form input[type="number"] {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.settings-form input[type="email"]:focus,
.settings-form input[type="number"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
    transform: translateY(-1px);
}

#save-settings-btn {
    margin-top: 10px;
    align-self: flex-start;
}

/* Responsive pour les paramètres */
@media (min-width: 768px) {
    .settings-form {
        grid-template-columns: 1fr 1fr;
        align-items: end;
    }
    
    #save-settings-btn {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo {
        font-size: 2.5rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .btn-primary {
        width: 100%;
    }
    
    section {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .section-header h2 {
        text-align: center;
    }
    
    .btn-secondary {
        width: 100%;
        padding: 15px;
    }
}
/* Global layout with sidebar */
.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid #e6e8eb;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
}

.sidebar-header .brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.sidebar-nav {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  padding: 10px 12px;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-weight: 500;
}

.nav-item:hover {
  background: #f3f4f6;
}

.nav-item.active {
  background: #111827;
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid #e6e8eb;
  padding-top: 12px;
}

.workspace {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

/* Profile (ancienne classe pour compatibilité) */
.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--accent);
  border: 1px solid var(--line);
}

.ws-name { font-weight: 600; color: #111827; }
.ws-sub { font-size: 12px; color: #6b7280; }

.content-area {
  background: #f8fafc;
}

/* Adjust container spacing inside content area */
.content-area .container {
  max-width: 1100px;
  padding: 28px 32px;
}

/* Header tweaks to match clean look */
.header {
  text-align: left;
  margin-bottom: 24px;
  padding: 0 0 8px 0;
}

.logo {
  font-size: 1.5rem;
  color: #111827;
  text-shadow: none;
}

.subtitle {
  color: #6b7280;
}

/* Cards appearance closer to neutral UI */
section {
  border-radius: 12px;
}

/* Responsive: collapse sidebar on small screens */
@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    border-right: none;
    border-bottom: 1px solid #e6e8eb;
  }
}
.feed-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.feed-info-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.feed-info-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.avatar-wrapper {
  position: relative;
  width: 28px;
  height: 28px;
}
.avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
}
.avatar-fallback {
  width: 28px;
  height: 28px;
}

/* Styles spécifiques pour les chaînes YouTube */
.youtube-channel .avatar-wrapper {
  width: 48px;
  height: 48px;
}

.youtube-channel .avatar-img,
.youtube-channel .avatar-fallback {
  width: 48px;
  height: 48px;
}

.youtube-channel .feed-info-left {
  gap: 15px;
}

.youtube-channel .channel-name {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.channel-access-btn {
  background: #ff0000;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.channel-access-btn:hover {
  background: #cc0000;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
}

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

/* Icône pour le bouton d'accès à la chaîne */
.channel-access-btn::before {
  content: "▶";
  font-size: 0.8em;
}

/* Styles pour la configuration des prompts */
.prompt-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.prompt-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 20px;
  background: var(--bg, #ffffff);
  color: var(--text, #0f172a);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.prompt-bubble:hover {
  background: var(--accent, #f3f4f6);
  border-color: var(--primary, #111827);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.prompt-bubble.active {
  background: var(--primary, #111827);
  color: white;
  border-color: var(--primary, #111827);
}

.prompt-bubble.active:hover {
  background: #374151;
  border-color: #374151;
}

/* Responsive pour les bulles */
@media (max-width: 720px) {
  .prompt-bubbles {
    gap: 6px;
  }
  
  .prompt-bubble {
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* User Section */
.user-section {
  padding: 12px;
  border-radius: 12px;
  background: var(--accent);
  border: 1px solid var(--line);
}

.user-guest, .user-connected {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-connected {
  position: relative;
}

.user-menu-icon {
  width: 20px;
  height: 20px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  margin-left: auto;
}

.user-menu-icon:hover {
  opacity: 1;
}

.user-menu-icon svg {
  width: 100%;
  height: 100%;
}

.guest-avatar {
  background: var(--muted);
  opacity: 0.7;
}

.guest-avatar svg {
  width: 18px;
  height: 18px;
}

/* Auth Modal */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.auth-modal {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.auth-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.auth-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: var(--muted);
  transition: all 0.2s;
}

.auth-modal-close:hover {
  background: var(--accent);
  color: var(--text);
}

.auth-modal-close svg {
  width: 20px;
  height: 20px;
}

.auth-modal-content {
  padding: 24px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--accent);
  padding: 4px;
  border-radius: 10px;
}

.auth-tab {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-method {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.auth-form-group input {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s;
}

.auth-form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.auth-btn.primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

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

.auth-btn.secondary:hover {
  background: var(--line);
}

.auth-buttons {
  display: flex;
  gap: 12px;
}

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

.auth-help {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

.auth-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.auth-message.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.auth-message.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* User Menu */
.user-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  animation: fadeIn 0.2s ease-out;
}

.user-menu {
  position: absolute;
  top: 80px;
  left: 20px;
  width: 280px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: slideDown 0.2s ease-out;
  overflow: hidden;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.user-menu-items {
  padding: 8px;
}

.user-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.user-menu-item:hover {
  background: var(--accent);
}

.user-menu-item svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

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

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

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