/* TemplateMonster style top bar and stage */
:root {
    --tm-bar-height: 50px;
    --tm-bar-bg: #23282d;
    --tm-bar-text: #ffffff;
    --tm-stage-bg: #eef1f5;
    --tm-accent: #28a745;
}

#tm-preview-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
    display: flex !important;
    flex-direction: column !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    background: var(--tm-stage-bg) !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.tm-in-iframe #tm-preview-wrapper {
    display: none !important;
}

#tm-preview-bar {
    height: var(--tm-bar-height) !important;
    min-height: var(--tm-bar-height) !important;
    background: var(--tm-bar-bg) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    color: var(--tm-bar-text) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2) !important;
    user-select: none !important;
}

.tm-bar-center {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
    gap: 12px !important;
}

.tm-device-switcher {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: rgba(0, 0, 0, 0.28) !important;
    padding: 4px 6px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.tm-switcher-divider {
    width: 1px !important;
    height: 22px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    margin: 0 4px !important;
}

.tm-device-btn {
    background: transparent !important;
    border: none !important;
    color: #888d94 !important;
    font-size: 16px !important;
    height: 34px !important;
    padding: 0 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    gap: 6px !important;
}

.tm-device-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

.tm-device-btn.active,
.tm-device-btn[aria-pressed="true"] {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.24) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
}

.tm-rotate-btn {
    font-size: 13px !important;
    color: #cbd5e1 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.tm-rotate-btn:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
}

.tm-rotate-btn.landscape i {
    transform: rotate(90deg) !important;
    transition: transform 0.25s ease !important;
}

.tm-rotate-btn i {
    transition: transform 0.25s ease !important;
}

.tm-orientation-label {
    font-size: 11.5px !important;
    font-weight: 500 !important;
    letter-spacing: 0.3px !important;
    text-transform: capitalize !important;
}

.tm-resolution-badge {
    font-size: 11px !important;
    color: #94a3b8 !important;
    background: rgba(0, 0, 0, 0.2) !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    letter-spacing: 0.3px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.tm-bar-left {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
}

.tm-bar-right {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 1 !important;
    justify-content: flex-end !important;
}

.tm-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 6px 14px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    border: none !important;
    transition: all 0.2s !important;
    line-height: 1.4 !important;
}

.tm-btn-primary {
    background: #28a745 !important;
    color: #ffffff !important;
}

.tm-btn-primary:hover {
    background: #218838 !important;
    color: #ffffff !important;
}

.tm-btn-secondary {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    padding: 6px 10px !important;
}

.tm-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22) !important;
}

.tm-icon-btn {
    background: transparent !important;
    border: none !important;
    color: #888d94 !important;
    font-size: 16px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: color 0.2s !important;
}

.tm-icon-btn:hover {
    color: #ffffff !important;
}

/* Stage & Frame */
#tm-preview-stage {
    flex: 1 !important;
    height: calc(100vh - var(--tm-bar-height)) !important;
    width: 100vw !important;
    background: var(--tm-stage-bg) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: stretch !important;
    overflow: hidden !important;
    position: relative !important;
    box-sizing: border-box !important;
}

#tm-frame-holder {
    height: 100% !important;
    display: flex !important;
    justify-content: center !important;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    background: #ffffff !important;
    margin: 0 auto !important;
}

/* Desktop */
#tm-frame-holder.device-desktop {
    width: 100% !important;
    box-shadow: none !important;
}

/* Tablet Portrait (768px) */
#tm-frame-holder.device-tablet-portrait,
#tm-frame-holder.device-tablet {
    width: 768px !important;
    max-width: 100% !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.2) !important;
}

/* Tablet Landscape (1024px) */
#tm-frame-holder.device-tablet-landscape {
    width: 1024px !important;
    max-width: 100% !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.2) !important;
}

/* Mobile Portrait (414px) */
#tm-frame-holder.device-mobile-portrait,
#tm-frame-holder.device-mobile {
    width: 414px !important;
    max-width: 100% !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.2) !important;
}

/* Mobile Landscape (812px) */
#tm-frame-holder.device-mobile-landscape {
    width: 812px !important;
    max-width: 100% !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.2) !important;
}

#tm-preview-iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block !important;
    background: #ffffff !important;
}
