/**
 * Oracle Collective UX Enhancements - Styles
 * Phase 6: Advanced user experience styling
 *
 * Copyright (c) 2025 Tammy L Casey
 */

/* ============================================================================
   STICKY NAVIGATION
   ============================================================================ */

.dashboard-header.sticky,
header.sticky,
nav.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(138, 43, 226, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4B0082 0%, #8A2BE2 100%);
    color: #C0C0C0;
    border: 2px solid #8A2BE2;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.4);
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.6);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* ============================================================================
   SKIP LINK (Accessibility)
   ============================================================================ */

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #8A2BE2;
    color: #000;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.toast {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid rgba(138, 43, 226, 0.5);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    color: #C0C0C0;
}

.toast.active {
    transform: translateX(0);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    white-space: pre-line;
}

.toast-close {
    background: none;
    border: none;
    color: #C0C0C0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.toast-close:hover {
    background: rgba(192, 192, 192, 0.1);
}

/* Toast Types */
.toast-success {
    border-color: #00ff00;
}

.toast-success .toast-icon {
    color: #00ff00;
}

.toast-error {
    border-color: #ff0000;
}

.toast-error .toast-icon {
    color: #ff0000;
}

.toast-warning {
    border-color: #ffaa00;
}

.toast-warning .toast-icon {
    color: #ffaa00;
}

.toast-info {
    border-color: #8A2BE2;
}

.toast-info .toast-icon {
    color: #8A2BE2;
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(138, 43, 226, 0.2);
    border-top-color: #8A2BE2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #C0C0C0;
    font-size: 0.9rem;
    margin: 0;
}

/* Skeleton Loading */
.skeleton-card {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(138, 43, 226, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.skeleton-header {
    height: 24px;
    background: linear-gradient(
        90deg,
        rgba(138, 43, 226, 0.1) 0%,
        rgba(138, 43, 226, 0.2) 50%,
        rgba(138, 43, 226, 0.1) 100%
    );
    border-radius: 4px;
    margin-bottom: 1rem;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(
        90deg,
        rgba(138, 43, 226, 0.1) 0%,
        rgba(138, 43, 226, 0.2) 50%,
        rgba(138, 43, 226, 0.1) 100%
    );
    border-radius: 4px;
    margin-bottom: 0.5rem;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-text.short {
    width: 60%;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================================================
   MOBILE MENU
   ============================================================================ */

.mobile-menu-button {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #8A2BE2;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 0;
    transition: all 0.3s ease;
}

.mobile-menu-button:hover {
    background: rgba(138, 43, 226, 0.2);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

.hamburger-line {
    width: 30px;
    height: 3px;
    background: #C0C0C0;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-button.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-button.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-button.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .mobile-menu-button:not(.hidden) {
        display: flex;
    }

    .category-filters,
    nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: rgba(0, 0, 0, 0.98);
        border-right: 2px solid #8A2BE2;
        flex-direction: column;
        padding: 5rem 1rem 1rem;
        overflow-y: auto;
        transition: left 0.3s ease;
        z-index: 1000;
    }

    .category-filters.mobile-open,
    nav.mobile-open {
        left: 0;
        box-shadow: 4px 0 20px rgba(138, 43, 226, 0.3);
    }

    .category-filter {
        width: 100%;
        text-align: left;
        margin-bottom: 0.5rem;
    }
}

/* ============================================================================
   TOOLTIPS
   ============================================================================ */

.tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    color: #C0C0C0;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #8A2BE2;
    font-size: 0.875rem;
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.tooltip.active {
    opacity: 1;
    transform: translateY(0);
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #8A2BE2;
}

/* ============================================================================
   QUICK ACCESS MENU (FAB)
   ============================================================================ */

.quick-access-fab {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 999;
}

.fab-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4B0082 0%, #8A2BE2 100%);
    color: #C0C0C0;
    border: 2px solid #8A2BE2;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.fab-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.6);
}

.quick-access-fab.open .fab-button {
    transform: rotate(45deg);
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.quick-access-fab.open .fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-action {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #8A2BE2;
    color: #C0C0C0;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.fab-action:hover {
    background: rgba(138, 43, 226, 0.2);
    transform: translateX(-5px);
    box-shadow: 0 6px 15px rgba(138, 43, 226, 0.4);
}

/* ============================================================================
   FOCUS INDICATORS (Enhanced Accessibility)
   ============================================================================ */

.required-indicator {
    color: #ff0000;
    font-weight: bold;
    margin-left: 0.25rem;
}

/* High Contrast Focus for Keyboard Navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #8A2BE2;
    outline-offset: 2px;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .toast-container {
        right: 1rem;
        left: 1rem;
        top: 1rem;
        max-width: none;
    }

    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }

    .quick-access-fab {
        bottom: 1rem;
        left: 1rem;
    }

    .fab-button {
        width: 50px;
        height: 50px;
    }

    .fab-action {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .toast {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .tooltip {
        max-width: 200px;
        font-size: 0.8rem;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .scroll-to-top,
    .quick-access-fab,
    .mobile-menu-button,
    .toast-container,
    .tooltip {
        display: none !important;
    }
}
