/* 
 * Global Styles & Core Layout
 * =============================
 * Defines base styles for the body, map container, and icon system.
 */

/* --- Base & Map --- */

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #fbfbfb;
    /* Consistent light background for the home screen and pages */
    font-family: 'Roboto', sans-serif;
}

#map {
    height: 100%;
}

/* 
 * --- Deprecated Flex Container --- 
 * The .custom-map-controls-br class is no longer used for positioning.
 * Each button module now uses absolute positioning for true modularity.
 * This class is left empty to ensure it doesn't interfere with the new layout.
 */


/* --- General Button & Icon Styling --- */

.custom-map-button {
    background-color: #2a2a2a;
    /* Dark gray background */
    border: 1px solid #444;
    /* Subtle border */
    border-radius: 50%;
    /* Make it circular */
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s, box-shadow 0.2s;
    width: 45px;
    /* New standardized width */
    height: 45px;
    /* New standardized height */
}

.custom-map-button:hover {
    background-color: #3c3c3c;
    /* Lighter gray on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.custom-map-button .app-icon {
    color: #e3e3e3;
    /* Light icon color for contrast */
    font-size: 27px;
    /* New scaled icon size */
    transition: color 0.2s;
}

.custom-map-button:hover .app-icon {
    color: #fff;
    /* Brighter icon on hover */
}

/* --- Custom Tooltip (Left Side) --- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 15px);
    /* Position on the left of the element */
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(30, 30, 30, 0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, right 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    right: calc(100% + 9px);
    /* Position triangle on the left */
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(30, 30, 30, 0.9);
    /* Triangle pointing right */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, right 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 1000;
}

/* 僅在支援游標懸停的裝置上顯示提示 */
@media (hover: hover) {
    [data-tooltip]:hover::before {
        opacity: 1;
        visibility: visible;
        right: calc(100% + 10px);
    }

    [data-tooltip]:hover::after {
        opacity: 1;
        visibility: visible;
        right: calc(100% + 4px);
    }

    /* Global link style for Article List and other panes */
    #settings-modal-content-area a {
        color: #1a365d;
        text-decoration: underline;
    }

    #settings-modal-content-area a:hover {
        opacity: 0.8;
    }

    /* 當按鈕處於彈出/展開狀態時，隱藏 Data Tooltip 提示，避免干擾視覺 */
    #sensor-size-options-container.expanded+#sensor-size-wrapper [data-tooltip]::before,
    #sensor-size-options-container.expanded+#sensor-size-wrapper [data-tooltip]::after,
    #focal-length-container.expanded [data-tooltip]::before,
    #focal-length-container.expanded [data-tooltip]::after,
    #layers-container.expanded [data-tooltip]::before,
    #layers-container.expanded [data-tooltip]::after {
        display: none !important;
    }
}