/**
 * ZED360 Main Styles
 * Layout components and responsive design
 */

/* Sticky Header */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 20px;
}

.header-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--header-text);
}

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

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    background: var(--btn-primary-bg);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search Bar */
.header-search {
    flex: 1;
    max-width: 500px;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    overflow: hidden;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--input-text);
    font-size: 0.95rem;
}

.search-input::placeholder {
    color: var(--input-placeholder);
}

.search-input:focus {
    outline: none;
}

.search-btn {
    padding: 10px 15px;
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}



.theme-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.chat-btn {
    background: none;
    border: none;
    color: var(--header-text);
    cursor: pointer;
    padding: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.chat-btn:hover {
    color: var(--primary-color);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-secondary);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guest-menu-btn {
    border: none;
    background: transparent;
    color: var(--header-text);
}

.guest-menu-btn:hover {
    background: var(--bg-secondary);
}

.user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.user-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 250px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1001;
}

.user-dropdown.active {
    display: block;
}

.user-info {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.user-info strong {
    display: block;
    color: var(--text-primary);
}

.user-info small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}

.dropdown-currency-section {
    padding: 15px;
}

.dropdown-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.dropdown-currency-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--input-text);
    font-size: 0.9rem;
    cursor: pointer;
}

.dropdown-currency-select:focus {
    outline: none;
    border-color: var(--input-focus-border);
}

.dropdown-item {
    display: block;
    padding: 6px 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.dropdown-item.text-danger {
    color: var(--danger-color);
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--btn-outline-border);
    color: var(--btn-outline-text);
}

.btn-outline:hover {
    background: var(--btn-outline-border);
    color: var(--btn-primary-text);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 70px - 60px - 200px);
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-top: 1px solid var(--border-color);
    z-index: 999;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--nav-text);
    text-decoration: none;
    gap: 4px;
    transition: color 0.2s ease;
}

.bottom-nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

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

.bottom-nav-item.active svg {
    fill: var(--nav-active);
}

/* Desktop Footer */
.desktop-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-section ul li svg {
    margin-right: 8px;
    vertical-align: middle;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    max-width: 1400px;
    margin: 40px auto 0;
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 15px;
    }
    
    .header-search {
        max-width: 300px;
    }
    
    .search-form {
        display: none;
    }
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }
    
    .desktop-footer {
        display: none;
    }
    
    .header-container {
        height: 60px;
    }
    
    .header-search {
        display: none;
    }
    
    .currency-selector {
        display: none; /* Hide desktop currency selector on mobile */
    }
    
    .dropdown-currency-section {
        padding: 10px;
    }
    
    .dropdown-currency-select {
        width: 100%;
        padding: 8px;
        font-size: 1rem;
    }
    
    .auth-buttons {
        display: flex;
        gap: 8px;
    }
    
    .auth-buttons .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .auth-buttons .auth-btn-desktop {
        display: none; /* Only show login on mobile */
    }
    
    .main-content {
        padding-bottom: 80px;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 10px;
        gap: 10px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .theme-toggle,
    .notification-btn,
    .cart-btn,
    .user-menu-btn {
        width: 36px;
        height: 36px;
    }
}

/* Utility Classes */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 20px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }