/* ===========================
   Shared Components
   frontend/css/components.css
   =========================== */

/* ===========================
   Cards
   =========================== */
.card {
  background: white;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  max-width: 400px;
  width: 100%;
}

/* ===========================
   Buttons
   =========================== */
.btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn:hover {
  background: var(--secondary-blue);
}

/* ===========================
   Forms
   =========================== */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

/* ===========================
   Messages
   =========================== */
.message-error {
  background: #fef2f2;
  color: var(--error-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  border: 1px solid #fecaca;
}
.message-success {
  background: #f0fdf4;
  color: var(--success-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  border: 1px solid #bbf7d0;
}

/* ===========================
   Header Component
   =========================== */

.app-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    gap: 1rem;
}

/* Left section - Logo */
.header-left {
    flex-shrink: 0;
}

.header-left a {
    display: flex;
    align-items: center;
}

.header-left .logo {
    height: 40px;
    width: auto;
}

/* Center section - Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #ffffff;
    background: rgba(233, 69, 96, 0.3);
    border: 1px solid rgba(233, 69, 96, 0.5);
}

/* Right section - User info */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.header-mood {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.header-mood:hover {
    transform: scale(1.2);
}

.user-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.donate-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
    width: auto;
}

.donate-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(22, 163, 74, 0.4);
}

.logout-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: auto;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===========================
   Header Responsive
   =========================== */

@media (max-width: 1024px) {
    .header-content {
        padding: 0.5rem 1rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .donate-btn,
    .logout-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .header-left {
        order: 1;
    }
    
    .header-right {
        order: 2;
        gap: 0.5rem;
    }
    
    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 0.5rem;
        margin-top: 0.25rem;
    }
    
    .header-left .logo {
        height: 32px;
    }
    
    .user-name {
        display: none;
    }
    
    .nav-link {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .donate-btn {
        display: none;
    }
    
    .nav-link {
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
    }
}

/* ===========================
   Header Animations
   =========================== */

@keyframes pulse-gentle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   FIXED HEADER - Works on ALL pages
============================================ */

.app-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-bottom: 3px solid #0f3460;
}

/* Push content below fixed header */
/* Header is approximately 60-70px tall */
.app-container {
    padding-top: 70px;
}

/* Alternative: if app-container doesn't exist on some pages */
body {
    padding-top: 0; /* Reset - let app-container handle it */
}

/* For pages that inject header differently */
#app-header + main,
#app-header + .journal-main,
#app-header + .dashboard-main,
#app-header + .chat-container,
#app-header + .tracker-main,
#app-header + .settings-main,
#app-header + .support-main {
    padding-top: 0; /* Container already has padding */
}

/* ===========================
   Footer Component - Simplified
   Replace existing footer styles in components.css
   =========================== */

.app-footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: rgba(255, 255, 255, 0.8);
    margin-top: auto;
    border-top: 3px solid #0f3460;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-legal {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.footer-company {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.footer-address {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.footer-legal-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.footer-legal-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s ease;
}

.footer-legal-links a:hover {
    color: #e94560;
}

.footer-divider {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
}

/* Crisis section */
.footer-crisis {
    background: rgba(233, 69, 96, 0.15);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    flex-shrink: 0;
}

.crisis-text {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.crisis-text strong {
    color: #e94560;
}

.crisis-text a {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    transition: text-decoration-color 0.2s ease;
}

.crisis-text a:hover {
    text-decoration-color: #e94560;
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .footer-legal {
        align-items: center;
    }
    
    .footer-legal-links {
        justify-content: center;
    }
    
    .footer-crisis {
        width: 100%;
        text-align: center;
    }
    
    .crisis-text {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .footer-company,
    .footer-address {
        font-size: 0.7rem;
    }
    
    .footer-legal-links a {
        font-size: 0.75rem;
    }
}
