/* common.css - Common UI components and utilities */
:root {
  --primary: #215a40;
  --primary-light: #2b7452;
  --accent: #dbbf8b;
  --secondary: #367256;
  --highlight: #7dc6a0;
  --danger: #e74c3c;
  --success: #2b7452;
  --warning: #f39c12;
  --neutral-bg: #f8f9fa;
  --neutral-card: #ffffff;
  --neutral-border: #eaeaea;
  --neutral-text: #333333;
  --neutral-text-light: #666666;
  --neutral-text-lighter: #c3c3c3;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.12);
  --radius: 6px;
  --radius-sm: 4px;
  --transition: all 0.2s ease;
}

/* Header */
.header {
  padding: 16px 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--neutral-border);
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1rem;
  font-weight: 500;
  color: white;
  max-width: 90%; 
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 10px;
  cursor: pointer;
}

.cart-icon {
  position: relative;
  font-size: 1rem;
  color: white;
  cursor: pointer;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
}

/* Bottom navigation */
.bottom-nav {
  background: var(--neutral-card);
  border-top: 1px solid var(--neutral-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 12px 0 8px;
  box-shadow: var(--shadow);
  position: sticky;
  bottom: 0;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--neutral-text-lighter);
  font-size: 0.6rem;
  cursor: pointer;
  position: relative;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item i {
  font-size: 1.1rem;
}

#bottom-cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
}

/* Content transitions */
#content {
    opacity: 0;
    transition: opacity 0.2s ease;
}

#content.ready {
    opacity: 1 !important;
}

#content.hiding {
    opacity: 0 !important;
    transition: none !important;
}

/* Loading indicator */
.loading-container {
    text-align: center;
    padding: 3rem;
}

.loading-spinner {
    font-size: 2rem;
    color: var(--primary);
}

.loading-text {
    margin-top: 1rem;
    color: var(--neutral-text-light);
}

/* Error message */
.error-container {
    text-align: center;
    padding: 3rem;
}

.error-icon {
    font-size: 2rem;
    color: var(--danger);
}

.error-message {
    margin-top: 1rem;
    color: var(--neutral-text-light);
}

.error-retry-btn {
    margin-top: 1rem;
    padding: 0.5rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.error-retry-btn:hover {
    background: var(--primary-light);
}

/* Notification/Toast - Mobile Friendly with Centered Content */
.notification-toast {
    position: fixed;
    bottom: 80px;
    left: 12px;
    right: 12px;
    transform: none;
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow-hover);
    animation: slideUp 0.3s ease;
    white-space: normal;
    text-align: center;
    width: auto;
    max-width: none;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Optional blur effect - remove if not wanted */
.notification-toast {
    backdrop-filter: blur(10px);
}

/* Different types */
.notification-toast.success {
    background: var(--success);
}

.notification-toast.error {
    background: var(--danger);
}

/* Icon styling */
.notification-toast i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Message text */
.notification-toast span {
    line-height: 1.4;
    word-break: break-word;
    padding-top: 4px;
}

/* Animation for showing */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation for hiding */
.notification-toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

/* Optional: Different positions */
.notification-toast.top {
    top: 80px;
    bottom: auto;
}

.notification-toast.bottom {
    bottom: 80px;
    top: auto;
}

/* Tablet and up - center with max width */
@media (min-width: 768px) {
    .notification-toast {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: auto;
        min-width: 320px;
        max-width: 400px;
        white-space: nowrap;
        border-radius: 30px;
        backdrop-filter: none; /* Remove blur on desktop for cleaner look */
    }
    
    /* Update animations for centered position */
    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translate(-50%, 20px);
        }
        to {
            opacity: 1;
            transform: translate(-50%, 0);
        }
    }
    
    @keyframes fadeOut {
        from {
            opacity: 1;
            transform: translate(-50%, 0);
        }
        to {
            opacity: 0;
            transform: translate(-50%, -20px);
        }
    }
}

/* Rial symbol styling */
.rial {
    font-family: inherit;
}

/* Additional utility classes */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Header Logo Container */
.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    max-width: 90%;
}

.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}