/*
 * Logo Styles - Professional Branding
 * استایل‌های لوگو - برندینگ حرفه‌ای
 * Version: 1.0
 */




/* ============================================
   Site Branding & Logo
   ============================================ */

.site-branding {
    display: flex;
    align-items: center;
    z-index: 100;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo-link:hover {
    transform: translateY(-2px);
}

.logo-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: 4px;
}

/* SVG Logo */
.site-logo {
    width: 200px;
    height: 60px;
    display: block;
    transition: all 0.3s ease;
}

.site-logo:hover {
    filter: brightness(1.05);
}

/* Custom Logo Support */
.custom-logo-wrapper {
    display: inline-flex;
    align-items: center;
}

.custom-logo-link {
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.custom-logo-link:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.custom-logo {
    max-width: 200px;
    max-height: 60px;
    width: auto;
    height: auto;
    display: block;
}

/* Text Logo Fallback (اگر SVG لود نشد) */
.logo-text {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--dark);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    line-height: 1;
    display: block;
}

.logo-tagline {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--gray-600);
    display: block;
    margin-top: 0.25rem;
    letter-spacing: 0.5px;
}

/* Header Specific Logo Adjustments */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.site-header.scrolled .site-logo {
    width: 160px;
    height: 45px;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* ============================================
   Favicon Styles
   ============================================ */

/* Ensure proper favicon display across browsers */
link[rel="icon"],
link[rel="shortcut icon"] {
    type: image/svg+xml;
}

/* ============================================
   Dark Mode Support
   ============================================ */

@media (prefers-color-scheme: dark) {
    .site-header {
        background: rgba(26, 26, 46, 0.95);
        backdrop-filter: blur(20px);
    }
    
    /* Switch to light logo version for dark backgrounds */
    .logo-link .site-logo {
        /* You can swap SVG source here or use CSS filter */
        filter: brightness(1.2);
    }
    
    .logo-text {
        -webkit-text-fill-color: var(--white);
        background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
        -webkit-background-clip: text;
    }
    
    .logo-tagline {
        color: var(--gray-300);
    }
}

/* ============================================
   Responsive Design
   ============================================ */

/* Large Desktop */
@media (max-width: 1400px) {
    .header-container {
        max-width: 1200px;
    }
}

/* Laptop */
@media (max-width: 1200px) {
    .site-logo {
        width: 160px;
        height: 45px;
    }
    
    .header-container {
        padding: 1rem 1.5rem;
    }
}

/* Tablet */
@media (max-width: 992px) {
    .site-logo {
        width: 150px;
        height: 42px;
    }
    
    .header-container {
        padding: 0.875rem 1.25rem;
    }
}

/* Mobile Landscape */
@media (max-width: 768px) {
    .site-logo {
        width: 140px;
        height: 40px;
    }
    
    .header-container {
        padding: 0.75rem 1rem;
        gap: 1rem;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .logo-tagline {
        font-size: 0.5625rem;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .site-logo {
        width: 130px;
        height: 38px;
    }
    
    .header-container {
        padding: 0.75rem 1rem;
    }
    
    .logo-text {
        font-size: 1.375rem;
    }
}

/* Small Mobile */
@media (max-width: 360px) {
    .site-logo {
        width: 120px;
        height: 35px;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .logo-tagline {
        display: none; /* Hide tagline on very small screens */
    }
}

/* ============================================
   Logo in Footer
   ============================================ */

.site-footer .site-branding {
    margin-bottom: 1.5rem;
}

.site-footer .site-logo {
    width: 160px;
    height: 45px;
    opacity: 0.9;
}

.site-footer .logo-link:hover .site-logo {
    opacity: 1;
}

/* ============================================
   Loading State
   ============================================ */

.site-logo {
    animation: fadeInLogo 0.6s ease-out;
}

@keyframes fadeInLogo {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .site-logo {
        width: 140px;
        height: 40px;
    }
    
    .site-logo animate {
        display: none; /* Remove animations in print */
    }
}

/* ============================================
   Accessibility
   ============================================ */

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .logo-link {
        border: 2px solid transparent;
    }
    
    .logo-link:focus {
        border-color: currentColor;
        outline: 2px solid currentColor;
        outline-offset: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .site-logo animate,
    .site-logo circle[animate],
    .site-logo path[animate] {
        animation: none !important;
    }
    
    .logo-link:hover {
        transform: none;
    }
    
    .site-logo {
        animation: none;
    }
}

/* Focus Visible for Keyboard Navigation */
.logo-link:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
    border-radius: 6px;
}

/* ============================================
   Logo Variants
   ============================================ */

/* Compact Logo (for mobile menu or tight spaces) */
.logo-compact .site-logo {
    width: 45px;
    height: 45px;
}

.logo-compact .logo-text {
    display: none;
}

.logo-compact .logo-tagline {
    display: none;
}

/* Logo Only Icon (square version) */
.logo-icon-only {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 8px;
    padding: 0.5rem;
}

.logo-icon-only svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   Special Effects (Optional)
   ============================================ */

/* Glow effect on hover */
.logo-link:hover .site-logo {
    filter: drop-shadow(0 0 8px rgba(255, 177, 34, 0.3));
}

/* Pulse effect for LED indicators (already in SVG animations) */
.site-logo circle {
    transform-origin: center;
}

/* ============================================
   Browser Compatibility
   ============================================ */

/* Ensure SVG renders properly in older browsers */
.site-logo {
    shape-rendering: geometricPrecision;
    text-rendering: geometricPrecision;
}

/* Safari specific fixes */
@supports (-webkit-appearance: none) {
    .site-logo text {
        dominant-baseline: mathematical;
    }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .site-logo {
        shape-rendering: auto;
    }
}

/* ============================================
   Performance Optimizations
   ============================================ */

/* GPU acceleration for smoother animations */
.site-logo,
.logo-link {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduce paint areas */
.site-logo {
    contain: layout style paint;
}