/* Fixed Toolbar CSS - Responsive Positioning */

.fixed-toolbar {
    position: fixed;
    z-index: 9999;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* Mobile positioning (bottom) */
@media (max-width: 768px) {
    .fixed-toolbar {
        bottom: 0;
        left: 0;
        right: 0;
        padding: 8px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.2);
    }
}

/* Desktop positioning (right side) */
@media (min-width: 769px) {
    .fixed-toolbar {
        top: 20%;
        right: 20px;
        left: auto;
        bottom: auto;
        width: auto;
        padding: 10px 0;
        border-radius: 25px;
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

.fixed-toolbar .toolbar-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

/* Mobile container */
@media (max-width: 768px) {
    .fixed-toolbar .toolbar-container {
        justify-content: space-around;
        padding: 0 15px;
    }
}

/* Desktop container - vertical layout */
@media (min-width: 769px) {
    .fixed-toolbar .toolbar-container {
        flex-direction: column;
        justify-content: center;
        padding: 5px;
        gap: 8px;
        max-width: none;
        width: 60px;
    }
}

.fixed-toolbar .toolbar-item {
    text-align: center;
    position: relative;
}

/* Mobile toolbar items */
@media (max-width: 768px) {
    .fixed-toolbar .toolbar-item {
        flex: 1;
    }
}

/* Desktop toolbar items - vertical stack */
@media (min-width: 769px) {
    .fixed-toolbar .toolbar-item {
        flex: none;
        width: 50px;
        height: 50px;
        margin-bottom: 0;
    }
}

.fixed-toolbar .toolbar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Mobile toolbar links */
@media (max-width: 768px) {
    .fixed-toolbar .toolbar-link {
        flex-direction: column;
        padding: 8px 5px;
        min-height: 50px;
    }
    
    .fixed-toolbar .toolbar-link:hover {
        transform: translateY(-2px);
    }
}

/* Desktop toolbar links - icon only */
@media (min-width: 769px) {
    .fixed-toolbar .toolbar-link {
        flex-direction: column;
        padding: 12px 8px;
        min-height: 50px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        margin-bottom: 5px;
        gap: 0;
    }
    
    .fixed-toolbar .toolbar-link:hover {
        transform: scale(1.1);
        background: rgba(255, 255, 255, 0.2);
    }
}

.fixed-toolbar .toolbar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
}

.fixed-toolbar .toolbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Mobile icon styles */
@media (max-width: 768px) {
    .fixed-toolbar .toolbar-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 2px;
    }
}

/* Desktop icon styles - larger and centered */
@media (min-width: 769px) {
    .fixed-toolbar .toolbar-icon {
        width: 22px;
        height: 22px;
        font-size: 20px;
    }
}

.fixed-toolbar .toolbar-text {
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0.9;
}

/* Mobile text styles */
@media (max-width: 768px) {
    .fixed-toolbar .toolbar-text {
        font-size: 10px;
    }
}

/* Desktop text styles - hidden for icon-only display */
@media (min-width: 769px) {
    .fixed-toolbar .toolbar-text {
        display: none;
    }
}

/* Specific colors for each platform */
.fixed-toolbar .phone-item .toolbar-link:hover {
    background: rgba(34, 139, 34, 0.2);
}

.fixed-toolbar .sms-item .toolbar-link:hover {
    background: rgba(255, 193, 7, 0.2);
}

.fixed-toolbar .zalo-item .toolbar-link:hover {
    background: rgba(0, 123, 255, 0.2);
}

.fixed-toolbar .messenger-item .toolbar-link:hover {
    background: rgba(0, 132, 255, 0.2);
}

/* Animation for active state */
.fixed-toolbar .toolbar-link:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive design */
@media (max-width: 480px) {
    .fixed-toolbar .toolbar-text {
        font-size: 9px;
    }

    .fixed-toolbar .toolbar-icon {
        font-size: 16px;
        width: 20px;
        height: 20px;
    }

    .fixed-toolbar .toolbar-link {
        padding: 6px 3px;
        min-height: 45px;
    }
}

@media (max-width: 360px) {
    .fixed-toolbar .toolbar-text {
        font-size: 8px;
    }

    .fixed-toolbar .toolbar-icon {
        font-size: 14px;
        width: 18px;
        height: 18px;
    }
}

/* Hide toolbar on very small screens if needed */
@media (max-width: 280px) {
    .fixed-toolbar {
        display: none;
    }
}

/* Smooth entrance animation */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile animation (slide up from bottom) */
@media (max-width: 768px) {
    .fixed-toolbar {
        animation: slideUp 0.5s ease-out;
    }
}

/* Desktop animation (slide down from top) */
@media (min-width: 769px) {
    .fixed-toolbar {
        animation: slideDown 0.5s ease-out;
    }
}

/* Pulse animation for attention */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fixed-toolbar .toolbar-link.pulse {
    animation: pulse 2s infinite;
}

/* Adjustment for pages with fixed elements */
/* Mobile: padding bottom for fixed bottom toolbar */
@media (max-width: 768px) {
    body.has-fixed-toolbar {
        padding-bottom: 70px;
        padding-top: 0;
    }
}

/* Desktop: no padding needed for right-side toolbar */
@media (min-width: 769px) {
    body.has-fixed-toolbar {
        padding-top: 0;
        padding-bottom: 0;
        padding-right: 0;
    }
    
    /* Reset main header positioning */
    body.has-fixed-toolbar .main-header {
        top: auto;
    }
}

/* Custom icons using CSS for better performance */
.fixed-toolbar .icon-phone::before {
    content: '📞';
}

.fixed-toolbar .icon-sms::before {
    content: '💬';
}

.fixed-toolbar .icon-zalo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fixed-toolbar .icon-zalo::before {
    content: 'Z';
    background: linear-gradient(45deg, #0068ff, #0084ff);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    font-family: 'Arial', sans-serif;
    box-shadow: 0 2px 4px rgba(0, 132, 255, 0.3);
}

.fixed-toolbar .icon-messenger::before {
    content: '';
    background: linear-gradient(45deg, #0084ff, #00a4ff);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 132, 255, 0.3);
}

.fixed-toolbar .icon-messenger::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.477 2 2 6.477 2 12c0 2.765 1.122 5.263 2.937 7.063l-1.838 5.499a.5.5 0 0 0 .632.632l5.499-1.838A9.955 9.955 0 0 0 12 22c5.523 0 10-4.477 10-10S17.523 2 12 2zm1-3l-1.5 5L9 5.5l5 3.5z"/></svg>') no-repeat center;
    background-size: contain;
}

/* Tooltip for desktop - show text on hover */
@media (min-width: 769px) {
    .fixed-toolbar .toolbar-item {
        position: relative;
    }
    
    .fixed-toolbar .toolbar-item::before {
        content: attr(data-tooltip);
        position: absolute;
        right: 65px;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 12px;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 10000;
        pointer-events: none;
    }
    
    .fixed-toolbar .toolbar-item::after {
        content: '';
        position: absolute;
        right: 55px;
        top: 50%;
        transform: translateY(-50%);
        border-left: 6px solid rgba(0, 0, 0, 0.8);
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 10000;
    }
    
    .fixed-toolbar .toolbar-item:hover::before,
    .fixed-toolbar .toolbar-item:hover::after {
        opacity: 1;
        visibility: visible;
    }
}
