/**
 * Mactay Flying Bee Course Widget - Style Pack
 */

#mactay-bee-container {
    position: fixed;
    width: 60px;
    height: 60px;
    z-index: 99995;
    cursor: pointer;
    transition: transform 0.1s linear;
    user-select: none;
}

/* Wing flappers & SVG Mascot classes */
.mactay-bee-character {
    position: relative;
    width: 100%;
    height: 100%;
}

.mactay-bee-svg-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mactay-bee-svg-mascot {
    width: 56px;
    height: 56px;
    user-select: none;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
    overflow: visible;
}

.mactay-bee-body {
    position: absolute;
    width: 44px;
    height: 32px;
    background: var(--primary-color, #facc15);
    border-radius: 50% 50% 45% 45%;
    top: 14px;
    left: 8px;
    box-shadow: inset 0 -4px 6px rgba(0,0,0,0.15), 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 2;
}

.mactay-bee-stripes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 20%,
        var(--secondary-color, #1c1917) 20%,
        var(--secondary-color, #1c1917) 40%,
        transparent 40%,
        transparent 60%,
        var(--secondary-color, #1c1917) 60%,
        var(--secondary-color, #1c1917) 80%,
        transparent 80%
    );
}

.mactay-bee-stinger {
    position: absolute;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid var(--secondary-color, #1c1917);
    left: -2px;
    top: 12px;
    transform: rotate(15deg);
}

.mactay-bee-head {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--secondary-color, #1c1917);
    border-radius: 50%;
    top: 16px;
    right: 4px;
    z-index: 3;
}

.mactay-bee-eyes {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffffff;
    border-radius: 50%;
    top: 5px;
    right: 4px;
}

.mactay-bee-eyes::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: #000000;
    border-radius: 50%;
    top: 1px;
    right: 1px;
}

.mactay-bee-wings {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.mactay-wing {
    position: absolute;
    width: 16px;
    height: 24px;
    background: rgba(240, 248, 255, 0.85);
    border: 1.5px solid #d1d5db;
    border-radius: 50%;
    top: -2px;
    transform-origin: bottom center;
    animation: mactay-flap 0.15s infinite ease-in-out alternate;
}

.mactay-wing-left {
    left: 14px;
    transform: rotate(-25deg);
}

.mactay-wing-right {
    left: 26px;
    transform: rotate(25deg);
    animation-delay: 0.07s;
}

/* Pause on hover animation speed down */
.mactay-bee-paused .mactay-wing {
    animation: mactay-flap-slow 0.8s infinite ease-in-out alternate;
}

@keyframes mactay-flap {
    0% { transform: scaleY(1) rotate(-15deg); }
    100% { transform: scaleY(0.3) rotate(-35deg); }
}

@keyframes mactay-flap-slow {
    0% { transform: scaleY(1) rotate(-10deg); }
    100% { transform: scaleY(0.7) rotate(-20deg); }
}

/* Speech Bubble above the bee */
.mactay-bee-bubble {
    position: absolute;
    top: -42px;
    left: 50%;
    transform: translateX(-50%) scale(1);
    background: rgba(28, 25, 23, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #ffffff !important;
    font-size: 10px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#mactay-bee-container:hover .mactay-bee-bubble {
    transform: translateX(-50%) scale(1.05);
    border-color: #eab308;
}

.mactay-ping-dot {
    position: relative;
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #eab308;
    border-radius: 50%;
}

.mactay-ping-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #eab308;
    border-radius: 50%;
    top: 0;
    left: 0;
    animation: mactay-ping 1.2s infinite ease-out;
}

@keyframes mactay-ping {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3.5); opacity: 0; }
}

/* Badge count indicator */
#mactay-bee-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--accent-color, #ef4444);
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
    transition: opacity 0.3s, transform 0.3s;
}

.mactay-bee-indicator-hide {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

.mactay-bee-indicator-show {
    opacity: 1;
    transform: scale(1);
}

/* Floating Drawer Panel */
#mactay-course-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background: #1c1917; /* Slate dark default */
    color: #e7e5e4;
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.45);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mactay-drawer-closed {
    transform: translateX(100%);
}

.mactay-drawer-open {
    transform: translateX(0);
}

.mactay-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: #141210;
    border-bottom: 1px solid #292524;
}

.mactay-drawer-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mactay-avatar-badge {
    font-size: 24px;
    background: #292524;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mactay-drawer-branding h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.mactay-status-pulse {
    font-size: 10px;
    color: #10b981;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

#mactay-drawer-close {
    background: transparent;
    border: none;
    color: #a8a29e;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

#mactay-drawer-close:hover {
    color: white;
}

.mactay-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mactay-greeting-bubble {
    background: #292524;
    border-radius: 12px;
    padding: 14px 16px;
    border-left: 4px solid var(--primary-color, #facc15);
    font-size: 13.5px;
    line-height: 1.5;
}

.mactay-greeting-line {
    margin-bottom: 6px;
}

.mactay-greeting-line:last-child {
    margin-bottom: 0;
}

/* Filter controls */
.mactay-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#mactay-course-search {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #44403c;
    background: #0c0a09;
    color: white;
    font-size: 13px;
}

#mactay-course-search:focus {
    outline: none;
    border-color: var(--primary-color, #facc15);
}

.mactay-filter-tabs {
    display: flex;
    background: #0c0a09;
    border-radius: 8px;
    padding: 3px;
}

.mactay-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #a8a29e;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.mactay-tab-btn.active {
    background: #292524;
    color: white;
}

/* Course Listing styling */
#mactay-course-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mactay-loader {
    text-align: center;
    color: #a8a29e;
    font-size: 13px;
    padding: 40px 0;
}

.mactay-error, .mactay-empty {
    text-align: center;
    color: #ef4444;
    font-size: 13px;
    padding: 30px 0;
}

.mactay-empty {
    color: #a8a29e;
}

.mactay-course-card {
    background: #292524;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #44403c;
}

.mactay-course-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-bottom: 1px solid #44403c;
}

.mactay-course-body {
    padding: 16px;
}

.mactay-badge-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.mactay-cat-badge {
    background: rgba(250, 204, 21, 0.15);
    color: var(--primary-color, #facc15);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.mactay-status-badge {
    font-size: 9px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.mactay-status-badge.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.mactay-status-badge.status-upcoming {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.mactay-course-body h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.mactay-course-body p {
    margin: 0 0 12px 0;
    font-size: 12px;
    color: #d6d3d1;
    line-height: 1.4;
}

.mactay-details-meta {
    background: #1c1917;
    border-radius: 8px;
    padding: 10px;
    font-size: 11px;
    color: #a8a29e;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mactay-details-meta strong {
    color: #e7e5e4;
}

.mactay-pricing-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.mactay-price-badge {
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #1c1917;
}

.mactay-price-badge.onsite-p {
    border-left: 3px solid #facc15;
}

.mactay-price-badge.online-p {
    border-left: 3px solid #3b82f6;
}

.mactay-price-badge strong {
    color: white;
}

.mactay-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mactay-btn {
    text-decoration: none;
    text-align: center;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.mactay-btn:active {
    transform: scale(0.98);
}

.mactay-btn-enroll {
    background: var(--primary-color, #facc15);
    color: #1c1917;
}

.mactay-btn-enroll:hover {
    opacity: 0.9;
}

.mactay-btn-syllabus {
    background: #44403c;
    color: white;
    border: 1px solid #57534e;
}

.mactay-btn-syllabus:hover {
    background: #57534e;
}

/* Accessibility settings support */
@media (prefers-contrast: high) {
    #mactay-course-drawer {
        background: #000;
        border: 2px solid white;
    }
    .mactay-course-card {
        border: 2px solid white;
    }
}

@media (max-width: 480px) {
    #mactay-course-drawer {
        width: 100vw;
    }
}
