/* Player View Styles - Clean, minimal interface for players */

body {
    margin: 0;
    padding: 0;
    background: #1a1a1a;
    color: white;
    font-family: Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
}

/* Map Container - Full Screen */
#mapContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1a1a1a;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-container {
    position: relative;
    transform-origin: center center;
    transition: transform 0.3s ease;
    display: inline-block;
    min-width: 100px;
    min-height: 100px;
    background: #1a1a1a;
}

.canvas-container canvas {
    display: block;
}

#mapCanvas, #gridCanvas, #fogCanvas, #tokenCanvas {
    position: absolute;
    top: 0;
    left: 0;
}

#mapCanvas {
    z-index: 1;
}

#gridCanvas {
    z-index: 2;
    pointer-events: none;
}

#fogCanvas {
    z-index: 3;
    pointer-events: none;
}

#tokenCanvas {
    z-index: 4;
    pointer-events: none; /* Read-only for players */
    cursor: default;
}

/* Connection Status Indicator */
.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(42, 42, 42, 0.9);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid #666;
    transition: all 0.3s ease;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.connecting {
    background: #ff9800;
}

.status-dot.connected {
    background: #4CAF50;
    animation: none;
}

.status-dot.disconnected {
    background: #f44336;
}

.status-dot.syncing {
    background: #4a90e2;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* View Controls - Minimal and unobtrusive */
.view-controls {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(42, 42, 42, 0.9);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    border: 1px solid #666;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.view-controls:hover {
    opacity: 1;
}

.control-btn {
    background: transparent;
    border: 1px solid #666;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: #4a90e2;
}

.view-info {
    font-size: 11px;
    color: #aaa;
    font-weight: normal;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #333;
    border-top: 4px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h2 {
    color: #4a90e2;
    margin: 0 0 15px 0;
    font-size: 24px;
}

.loading-content p {
    color: #aaa;
    margin: 0;
    font-size: 16px;
}

/* Auto-hide controls after inactivity */
.view-controls.auto-hide {
    opacity: 0;
    pointer-events: none;
}

.connection-status.auto-hide {
    opacity: 0.3;
}

/* Fullscreen mode adjustments */
.fullscreen-mode .view-controls,
.fullscreen-mode .connection-status {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.fullscreen-mode:hover .view-controls,
.fullscreen-mode:hover .connection-status {
    opacity: 0.8;
    pointer-events: all;
}

/* Token hover effects for players */
.token-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    border: 1px solid #666;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -100%);
    margin-top: -10px;
}

.token-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Sync notification */
.sync-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(74, 144, 226, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
}

.sync-notification.show {
    transform: translateX(0);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .view-controls {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        gap: 10px;
    }
    
    .connection-status {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
    }
    
    .control-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .view-info {
        display: none; /* Hide info text on mobile */
    }
    
    .loading-content {
        padding: 20px;
    }
    
    .loading-content h2 {
        font-size: 20px;
    }
    
    .loading-content p {
        font-size: 14px;
    }
}

/* Print styles - hide UI elements when printing */
@media print {
    .view-controls,
    .connection-status,
    .loading-overlay,
    .sync-notification {
        display: none !important;
    }
}