/**
 * Top Bar Component
 *
 * A fixed bar that appears above the main header, containing contact information
 * and social media links. Follows the KJS Lofts design pattern.
 *
 * Features:
 * - Contact information (phone, email) on the left
 * - Social media icons on the right
 * - Responsive design (hidden on mobile)
 * - Subtle styling with hover effects
 */

/* ============================================
   Top Bar Container
   ============================================ */

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    padding: 8px 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

/* Optional: Hide on scroll down, show on scroll up */
.top-bar.hidden {
    transform: translateY(-100%);
}

/* ============================================
   Inner Container
   ============================================ */

.top-bar__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================
   Left Side - Contact Information
   ============================================ */

.top-bar__content {
    display: flex;
    align-items: center;
    gap: 25px;
}

.top-bar__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text, #000000);
    text-decoration: none;
    transition: color 0.3s ease;
}

.top-bar__item:hover {
    color: var(--color-secondary, #0fb6ee);
}

/* Icon styling using pseudo-elements */
.top-bar__item--phone::before,
.top-bar__item--email::before {
    font-family: 'Font Awesome 5 Free', 'FontAwesome';
    font-weight: 900;
    font-size: 14px;
    color: var(--color-secondary, #0fb6ee);
    transition: transform 0.3s ease;
}

.top-bar__item--phone::before {
    content: '\f095'; /* fa-phone */
}

.top-bar__item--email::before {
    content: '\f0e0'; /* fa-envelope */
}

.top-bar__item:hover::before {
    transform: scale(1.1);
}

/* Text within contact items */
.top-bar__item-text {
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* ============================================
   Right Side - Social Media Links
   ============================================ */

.top-bar__social {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-bar__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: transparent;
    color: var(--color-text, #000000);
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.top-bar__social-link:hover {
    color: #ffffff;
    background-color: var(--color-secondary, #0fb6ee);
    transform: translateY(-2px);
}

/* Social media icon styling */
.top-bar__social-link i {
    font-size: 16px;
}

/* Alternative: Using pseudo-elements for icons */
.top-bar__social-link--twitter::before,
.top-bar__social-link--facebook::before,
.top-bar__social-link--instagram::before,
.top-bar__social-link--linkedin::before {
    font-family: 'Font Awesome 5 Brands', 'FontAwesome';
    font-weight: 400;
}

.top-bar__social-link--twitter::before {
    content: '\f099'; /* fa-twitter */
}

.top-bar__social-link--facebook::before {
    content: '\f09a'; /* fa-facebook */
}

.top-bar__social-link--instagram::before {
    content: '\f16d'; /* fa-instagram */
}

.top-bar__social-link--linkedin::before {
    content: '\f0e1'; /* fa-linkedin */
}

/* ============================================
   Accessibility
   ============================================ */

/* Screen reader only text */
.top-bar__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states for keyboard navigation */
.top-bar__item:focus,
.top-bar__social-link:focus {
    outline: 2px solid var(--color-secondary, #0fb6ee);
    outline-offset: 2px;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet adjustments */
@media (max-width: 1024px) {
    .top-bar__container {
        padding: 0 15px;
    }

    .top-bar__content {
        gap: 20px;
    }

    .top-bar__item {
        font-size: 13px;
    }
}

/* Hide on mobile */
@media (max-width: 959px) {
    .top-bar {
        display: none;
    }
}

/* Small tablet - reduce spacing */
@media (max-width: 768px) and (min-width: 960px) {
    .top-bar__content {
        gap: 15px;
    }

    .top-bar__social {
        gap: 12px;
    }

    .top-bar__social-link {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

/* ============================================
   Optional Variants
   ============================================ */

/* Dark theme variant */
.top-bar--dark {
    background-color: #1a1a1a;
    border-bottom-color: #333333;
}

.top-bar--dark .top-bar__item {
    color: #ffffff;
}

.top-bar--dark .top-bar__social-link {
    color: #ffffff;
}

.top-bar--dark .top-bar__social-link:hover {
    color: #1a1a1a;
}

/* Transparent variant (for overlaying on hero images) */
.top-bar--transparent {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Compact variant (less padding) */
.top-bar--compact {
    padding: 5px 0;
}

/* ============================================
   Animation Enhancements
   ============================================ */

/* Slide in animation on page load */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.top-bar--animated {
    animation: slideDown 0.5s ease-out;
}

/* Pulse effect for contact items on hover */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.top-bar__item:hover .top-bar__item-text {
    animation: pulse 0.6s ease-in-out;
}
