/* ========================================
   DASHBOARD DEMO - Gallery Modal Styles
   ======================================== */

/* Variáveis de cores por tema */
:root {
    --demo-rh: #17a2b8;
    --demo-vendas: #3498db;
    --demo-financeiro: #f39c12;
}

/* Botões Flutuantes Container */
.floating-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

/* Botão Flutuante Demo */
.demo-float {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, #1a4d6e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(43, 111, 158, 0.4);
    transition: all 0.3s ease;
    animation: demoPulse 2s infinite;
    position: relative;
}

.demo-float:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(43, 111, 158, 0.5);
    animation: none;
}

.demo-float i {
    transition: transform 0.3s ease;
}

.demo-float:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* Tooltip do Demo */
.demo-tooltip {
    position: absolute;
    right: 70px;
    background: var(--primary);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.demo-nudge {
    position: absolute;
    right: 76px;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background: linear-gradient(135deg, #ffd166 0%, #ff9f1c 100%);
    color: #17324a;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 10px 24px rgba(255, 159, 28, 0.35);
    pointer-events: none;
}

.demo-nudge::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #ffb22f;
}

.demo-nudge.is-visible {
    opacity: 1;
    visibility: visible;
    animation: demoNudgeIn 0.45s ease forwards, demoNudgeGlow 1.2s ease-in-out infinite;
}

.demo-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--primary);
}

.demo-float:hover .demo-tooltip {
    opacity: 1;
    visibility: visible;
    right: 75px;
}

@keyframes demoPulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(43, 111, 158, 0.4);
    }
    50% {
        box-shadow: 0 6px 30px rgba(43, 111, 158, 0.6), 0 0 0 10px rgba(43, 111, 158, 0.1);
    }
}

@keyframes demoNudgeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(8px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0) scale(1);
    }
}

@keyframes demoNudgeGlow {
    0%, 100% {
        box-shadow: 0 10px 24px rgba(255, 159, 28, 0.35);
    }
    50% {
        box-shadow: 0 12px 28px rgba(255, 159, 28, 0.5);
    }
}

/* Modal Overlay */
.demo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 40, 0.9);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.demo-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container - Gallery Version */
.demo-modal-gallery {
    background: linear-gradient(180deg, #0d1b2a 0%, #1a2f45 100%);
    border-radius: 1.5rem;
    width: min(96vw, 1480px);
    max-width: 1480px;
    height: min(94vh, 980px);
    max-height: 94vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-modal-overlay.active .demo-modal-gallery {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.demo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.8rem;
    background: linear-gradient(135deg, #1a3a52 0%, #0d1b2a 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dashboard-switcher {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.dashboard-switcher-header {
    flex: 1;
}

.demo-close-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-close-btn:hover {
    background: rgba(255,100,100,0.3);
    transform: rotate(90deg);
}

/* Modal Body */
.demo-modal-body {
    padding: 0.75rem 1rem 1rem;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.demo-modal-viewer-body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.dashboard-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: white;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
}

.dashboard-switch:hover,
.dashboard-switch.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.24);
    transform: translateY(-2px);
}

.dashboard-switch span {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dashboard-switch strong {
    font-size: 0.88rem;
}

.dashboard-switch small {
    color: #9bb0bf;
    font-size: 0.72rem;
}

.dashboard-switch-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.dashboard-switch-icon.rh {
    background: rgba(23, 162, 184, 0.18);
    color: #4fd1de;
}

.dashboard-switch-icon.vendas {
    background: rgba(52, 152, 219, 0.18);
    color: #74b9ff;
}

.dashboard-switch-icon.financeiro {
    background: rgba(243, 156, 18, 0.18);
    color: #f7b84b;
}

.dashboard-frame-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1;
    min-height: 0;
}

.dashboard-frame-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-frame-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dashboard-frame-copy strong {
    color: white;
    font-size: 0.84rem;
}

.dashboard-frame-copy span {
    color: #93a7b7;
    font-size: 0.74rem;
}

.dashboard-frame-wrap {
    position: relative;
    min-height: 0;
    flex: 1;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0b1622;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-frame {
    width: 117.647%;
    height: 117.647%;
    min-height: 79vh;
    border: none;
    display: block;
    background: white;
    transform: scale(0.85);
    transform-origin: top left;
}

.dashboard-frame-wrap.is-rh .dashboard-frame {
    width: 116.279%;
    height: 116.279%;
    transform: scale(0.86);
}

.dashboard-frame-wrap.is-vendas .dashboard-frame {
    width: 121.951%;
    height: 121.951%;
    transform: scale(0.82);
}

.dashboard-frame-wrap.is-financeiro .dashboard-frame {
    width: 123.457%;
    height: 123.457%;
    transform: scale(0.81);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .demo-modal-gallery {
        width: calc(100vw - 18px);
        height: calc(100vh - 18px);
        max-height: calc(100vh - 18px);
        border-radius: 1.1rem;
    }

    .dashboard-switcher {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-switch {
        min-width: 0;
    }

    .demo-modal-header {
        align-items: flex-start;
    }

    .dashboard-switch span {
        min-width: 0;
    }

    .dashboard-switch small {
        display: none;
    }

    .dashboard-frame {
        width: 111.111%;
        height: 111.111%;
        min-height: 62vh;
        transform: scale(0.9);
    }

    .dashboard-frame-wrap.is-rh .dashboard-frame {
        width: 109.89%;
        height: 109.89%;
        transform: scale(0.91);
    }

    .dashboard-frame-wrap.is-vendas .dashboard-frame {
        width: 114.943%;
        height: 114.943%;
        transform: scale(0.87);
    }

    .dashboard-frame-wrap.is-financeiro .dashboard-frame {
        width: 117.647%;
        height: 117.647%;
        transform: scale(0.85);
    }
}

@media (max-width: 600px) {
    .demo-nudge {
        font-size: 0.75rem;
        padding: 8px 12px;
        right: 70px;
    }

    .demo-modal-header {
        padding: 0.6rem;
        align-items: stretch;
    }

    .demo-modal-body {
        padding: 0.7rem;
    }

    .dashboard-switcher {
        grid-template-columns: 1fr;
    }

    .dashboard-switcher-header {
        order: 2;
    }

    .demo-close-btn {
        align-self: flex-end;
        order: 1;
    }

    .dashboard-switch {
        padding: 0.65rem 0.75rem;
    }

    .dashboard-frame {
        width: 107.527%;
        height: 107.527%;
        min-height: 58vh;
        transform: scale(0.93);
    }

    .dashboard-frame-wrap.is-rh .dashboard-frame {
        width: 106.383%;
        height: 106.383%;
        transform: scale(0.94);
    }

    .dashboard-frame-wrap.is-vendas .dashboard-frame {
        width: 109.89%;
        height: 109.89%;
        transform: scale(0.91);
    }

    .dashboard-frame-wrap.is-financeiro .dashboard-frame {
        width: 111.111%;
        height: 111.111%;
        transform: scale(0.9);
    }
    
    .floating-buttons {
        bottom: 20px;
        right: 20px;
    }
    
    .demo-float {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .dashboard-frame-toolbar {
        padding: 0.7rem;
            flex-direction: column;
            align-items: flex-start;
    }
}
