/* ==========================================================================
   PROMPTMASTER AI — COMPONENTE: LAYOUT (Grids, Header, Drawer e Responsividade)
   ========================================================================== */

/* 1. App Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: rgba(7, 9, 19, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 80px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px -2px var(--primary-glow);
  color: #FFF;
  animation: logoPulse 4s infinite alternate;
}

.logo-icon i {
  width: 22px;
  height: 22px;
}

@keyframes logoPulse {
  0% { transform: scale(1); box-shadow: 0 0 20px -2px var(--primary-glow); }
  100% { transform: scale(1.05); box-shadow: 0 0 30px 2px var(--secondary-glow); }
}

.logo-text h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFF;
  line-height: 1;
}

.logo-text h1 span {
  background: var(--premium-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Connection Server Status */
.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-indicator.online {
  background-color: var(--success);
}

.status-indicator.online::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  background-color: var(--success);
  animation: ping 1.5s infinite;
  opacity: 0.75;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

.status-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* 2. Main Grid Container */
.app-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  padding: 32px 40px;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 80px);
}

.workspace-section,
.analysis-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 3. Collapsible Sidebar Drawer */
.sidebar-drawer {
  position: fixed;
  top: 0;
  right: -450px;
  width: 440px;
  height: 100vh;
  background: rgba(8, 11, 23, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-glass);
  z-index: 1000;
  box-shadow: -20px 0 40px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-drawer.open {
  right: 0;
}

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

.drawer-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #FFF;
}

.drawer-title i {
  color: var(--primary);
  width: 24px;
  height: 24px;
}

.close-drawer-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.close-drawer-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFF;
}

.close-drawer-btn i {
  width: 20px;
  height: 20px;
}

/* Sidebar Overlay Backdrop */
.sidebar-backdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
}

/* 4. Responsive Queries */
@media (max-width: 1200px) {
  .app-container {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  
  .app-header {
    padding: 16px 20px;
  }
}

@media (max-width: 600px) {
  .app-header {
    flex-direction: column;
    height: auto;
    gap: 16px;
    padding: 20px;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .sidebar-drawer {
    width: 100%;
    right: -100%;
  }
}
