/* joint-topbar.css */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400&display=swap");
:root {
    --primary-bg: #1f2937;
    --primary-accent: #526279;    
    --primary-text: #ffffff;
    --hover-text: #d1d5db;
    --button-bg: #dc2626;
    --button-hover-bg: #b91c1c;
    --logo-bg: #f3f4f6;
    --text-accent: #f78929;
    --primary-color: #357aff;
    --secondary-color: #ffd7bb;
    --accent-color: #e7973c;
    --background-color: #f8f9fa;
    --text-color: #333333;
    --card-background: #ffffff;
}

body {
    padding-top: 60px; /* Adjust based on top bar height */
    font-family: "Roboto", sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 70%, var(--secondary-color) 100%);
}

.top-bar {
    background-color: var(--primary-bg);
    color: var(--primary-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: height 0.3s ease;
}

.home-button {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s;
    color: var(--text-accent);
}

.home-button:hover {
    opacity: 0.8;
}

.logo-container {
    background-color: var(--logo-bg);
    border-radius: 20%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 0.75rem;
    transition: width 0.3s ease, height 0.3s ease;
}

.home-button img {
    width: 30px;
    height: 30px;
    transition: width 0.3s ease, height 0.3s ease;
}

.product-name {
    font-size: 0.9rem;
    font-weight: bold;
}

.product-name1 {
    font-size: 0.9rem;
    color:white;
}

/* Styles for dynamic top bar */
.user-controls {
    display: flex;
    align-items: center;
}

.username-link {
    color: var(--primary-text);
    text-decoration: none;
    margin-right: 1rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.username-link:hover {
    color: var(--hover-text);
}

.username-link svg {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
}

.logout-button {
    padding: 0.5rem 1rem;
    background-color: var(--button-bg);
    color: var(--primary-text);
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: bold;
    transition: background-color 0.2s, padding 0.3s ease;
    display: flex;
    align-items: center;
  }

  .logout-button:hover {
    background-color: var(--button-hover-bg);
  }

  .logout-button svg {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
  }

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--primary-accent);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 10000;
    border-radius: 0.25rem;
    overflow: hidden;
}

.dropdown-content a {
    color: var(--primary-text);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--primary-accent);
}

.show {
    display: block;
}

.dropdown-content .divider {
    height: 1px;
    background-color: var(--primary-bg);
    margin: 5px 5px 0px 5px;
  }

  .dropdown-content .menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .dropdown-content .availability-indicator {
    font-size: 0.7rem;
    color: var(--hover-text);
    background-color: var(--primary-bg);
    padding: 2px 4px;
    border-radius: 3px;
    margin-left: 5px;
  }

  .dropdown-content a.disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

/* Styles for static top bar */
.language-toggle {
    display: flex;
    align-items: center;
}

.language-flag {
    cursor: pointer;
    width: 25px;
    height: auto;
    margin: 0 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.langslider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.langslider:before {
    position: absolute;
    content: "";
    height: 15px;
    width: 15px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .langslider {
    background-color: #2196F3;
}

input:checked + .langslider:before {
    transform: translateX(18px);
}

.hamburger {
    display: none;
    font-size: 20px;
    cursor: pointer;
}

/* Responsive styles */
@media (max-width: 768px) {
    body {
        padding-top: 50px;
        background: linear-gradient(110deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--secondary-color) 100%);
    }

    .top-bar {
        max-height: 50px;
        padding: 0.5rem;
    }

    .logo-container {
        width: 35px;
        height: 35px;
    }

    .home-button img {
        width: 25px;
        height: 25px;
    }

    .product-name {
        font-size: 0.875rem;
    }

    .logout-button svg {
        width: 16px;
        height: 16px;
        margin-right: 0;
    }

    .username-link svg {
        width: 16px;
        height: 16px;
    }

    .logout-button {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        text-indent: -9999px;
        white-space: nowrap;
        overflow: hidden; 
    }

    .dropdown-content {
        width: 100%;
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
    }

    .hamburger {
        display: block;
        margin-left: auto;
    }
}