/* --- VIEWPORT CONTAINER --- */
.viewport { position: relative; }

/* --- FLOATING TOOLBAR (More Spacious) --- */
.floating-toolbar {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);

    /* "Island" Look - Default Transparent */
    background: #131314ee; 
    border: 1px solid #27272a;
    border-radius: 7px; 
    
    padding: 8px 24px;   
    
    display: flex;
    align-items: center;
    gap: 13px;

    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 100;
    height: 52px; 
    box-sizing: border-box;

    /* [NEW] Smooth transition for the background change */
    transition: background 0.2s ease;
}

/* [NEW] Solid background on mouse enter */
.floating-toolbar:hover {
    background: #131314;
}

/* Vertical Divider */
.floating-toolbar .divider {
    width: 1px;
    height: 24px;
    background: #3f3f46;
    opacity: 0.3;
    /* Dividers don't need margin because the parent gap handles spacing now */
}

/* --- GROUPS --- */
.toolbar-group {
    display: flex;
    align-items: center;
    
    /* [CHANGED] Spread out buttons inside groups (e.g. between Target and Click) */
    gap: 12px; 
    
    position: relative;
}

/* --- ACTION BUTTONS --- */
.tool-btn { 
    position: relative; 
    background: transparent; 
    border: none; 
    color: #a1a1aa; 
    cursor: pointer; 
    
    width: 32px; 
    height: 32px;
    border-radius: 8px; 
    
    display: flex; 
    align-items: center; 
    justify-content: center;
    
    font-size: 15px; 
    transition: all 0.2s ease;
}

.tool-btn:hover { 
    background: #27272a; 
    color: #fff; 
    transform: translateY(-1px);
}

.tool-btn:active {
    transform: scale(0.95);
    background: #3f3f46;
}

/* --- PLAY BUTTON --- */
.tool-btn.play-control {
    background: #27272a;
    border: 1px solid #3f3f46;
    color: #e4e4e7;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 11px;
    padding-left: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.tool-btn.play-control:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* --- USER & INFO TEXT --- */
.user-info-block, .session-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: default;
    /* [CHANGED] Added min-width to ensure text doesn't feel cramped */
    min-width: 60px; 
}

.session-group{
    gap: 0;
}

/* Text Hierarchy */
.info-row.primary {
    font-size: 10px;
    font-weight: 700;
    color: #f4f4f5;
    letter-spacing: 0.3px;
}

.info-row.sub {
    font-size: 9px;
    color: #a1a1aa;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-row.label {
    font-size: 8px;
    text-transform: uppercase;
    color: #71717a;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.info-row.monospace {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Bot Status */
.bot-status-row { gap: 5px; }
.status-dot {
    width: 5px; height: 5px;
    background: #52525b;
    border-radius: 50%;
}
.bot-status-row.running .status-dot {
    background: #00e054;
    box-shadow: 0 0 6px #00e054;
}
.bot-status-row.running .status-text {
    color: #00e054;
}

/* --- VERSION TAG --- */
.version-tag {
    font-size: 9px;
    color: #52525b;
    font-family: monospace;
    position: relative;
    cursor: help;
    padding-left: 8px; /* Extra space from settings icon */
}

/* --- TOOLTIPS --- */
.tool-btn .tooltip,
.user-info-block .tooltip,
.session-group .tooltip,
.version-tag .tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 6px;
    padding: 5px 10px;
    width: max-content;
    min-width: 70px;
    text-align: center;
    
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.tool-btn:hover .tooltip,
.user-info-block:hover .tooltip,
.session-group:hover .tooltip,
.version-tag:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(16px);
}

.tooltip .tt-title {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}
.tooltip .tt-desc {
    display: block;
    font-size: 9px;
    color: #a1a1aa;
}

/* --- PRESERVED STYLES --- */
.canvas-container {
    background: #09090b;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.viewport-label {
    font-size: 24px;
    font-weight: 700;
    color: #0c0c0c;
    opacity: 0.4;
}
.view-mode-pill {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgb(131 131 131 / 12%);
    padding: 4px;
    border-radius: 30px;
    display: flex;
}
.view-btn {
    background: transparent;
    border: none;
    color: #bbb;
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
}
.view-btn.active {
    background: #444;
    color: white;
}

.user-info-block{
    flex-direction: row;
}

.fa-play{
    font-size: 9px;
}

.user-info-block .info-row.primary{
    margin-right: 1em;
}

.square-icon {
    /* 1. Size of the box area */
    width: 32px;
    height: 32px;

    /* 2. Center the icon */
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* 3. Style the box (Icon properties) */
    font-size: 18px; /* Controls the size of the square outline */
    color: #a1a1aa;  /* Gray color */
    
    /* Optional: If you want the button itself to have a background, add it here */
    /* background: #27272a; */
    /* border-radius: 6px; */
    
    cursor: pointer;
    transition: color 0.2s;
}

.square-icon:hover {
    color: #fff; /* White on hover */
}


/* --- EXPAND BUTTON --- */
.expand-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    
    width: 32px;
    height: 32px;
    border-radius: 8px;
    
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a1a1aa;
    
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 50; /* Above canvas, below toolbar tooltips */
}

.expand-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    transform: scale(1.05);
}

/* --- EXPANDED MODE STATE --- */
/* When the 'expanded' class is added to the viewport (or body) */
.viewport.expanded {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000; /* Ensure background covers everything */
}

/* Adjust toolbar position if needed when expanded */
.viewport.expanded .floating-toolbar {
    top: 32px; /* Slightly lower padding from top edge */
}

/* --- CLIENT IMAGE --- */
.client-view-img {
    /* Responsive Sizing */
    width: 100%;
    height: 100%;
    
    /* 'contain' ensures the whole image is visible and correct aspect ratio */
    /* Use 'cover' if you want it to fill the entire black space (might crop edges) */
    object-fit: contain; 
    
    /* Ensure it sits behind the floating controls */
    position: relative;
    z-index: 1; 
    
    /* Optional: Smooth fade in if it loads slowly */
    display: block;
}

/* Ensure controls stay on top of the image */
.view-mode-pill, .expand-btn {
    z-index: 10 !important; 
}

