* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 0%, #0f3460 100%);
    color: #e0e0e0;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    /* Prevent pull-to-refresh and overscroll on mobile */
    overscroll-behavior: none;
}

.screen {
    display: block;
}

.screen.hidden {
    display: none;
}

#main-screen {
    display: block;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

#main-screen.hidden {
    display: none;
}

/* Login Screen */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(15, 12, 41, 0.3);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#login-screen.hidden {
    display: none;
}

#login-screen h1 {
    font-size: 64px;
    margin-bottom: 40px;
    text-align: center;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(78, 204, 163, 0.3));
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

#login-screen #login-form {
    max-width: 400px;
    width: 20%;
    display: flex;
    flex-direction: column;
}

#login-screen input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #e0e0e0;
    font-size: 15px;
    padding: 14px 18px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

#login-screen input:focus {
    outline: none;
    border-color: rgba(78, 204, 163, 0.6);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(78, 204, 163, 0.1), 0 4px 12px rgba(0, 0, 0, 0.2);
}

#login-screen input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#login-screen button[type="submit"] {
    width: 100%;
    background: linear-gradient(116deg, #ff0095 0%, #8500ff 110%);
    border: none;
    border-radius: 12px;
    color: #000000;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.3);
    position: relative;
    overflow: hidden;
}

#login-screen button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(78, 204, 163, 0.4);
}

#login-screen button[type="submit"]:active {
    transform: translateY(0px);
}

#login-screen .error {
    max-width: 400px;
    width: 90%;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
    color: #ff6b6b;
    font-size: 13px;
    text-align: center;
}




/* Old login-container styles removed - all styles now in #login-screen section above */

.error {
    color: #ef4444;
    padding: 10px;
    text-align: center;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.error.hidden {
    display: none;
}

/* Header */
.header {
    position: absolute;
    top: 15px;
    right: 15px;
    left: auto;
    transform: none;
    width: auto;
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 1001;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 24px;
    color: #4ecca3;
    text-shadow: 0 2px 10px rgba(78, 204, 163, 0.3);
    display: none;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.header .header-info {
    display: flex;
    align-items: center;
    gap: 0;
}

.header .header-info #user-info {
    display: none;
}

.sidebar .device-list {
    padding: 0;
    margin: 0;
}

#logout-btn {
    padding: 8px 20px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.3s;
}

#logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

/* Admin Dropdown Menu */
.admin-dropdown {
    position: relative;
    display: inline-block;
}

.admin-btn {
    padding: 8px 14px;
    background: rgba(78, 204, 163, 0.2);
    border: 1px solid rgba(78, 204, 163, 0.3);
    border-radius: 6px;
    color: #4ecca3;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-btn:hover {
    background: rgba(78, 204, 163, 0.3);
    border-color: rgba(78, 204, 163, 0.5);
}

/* Mobile adaptations for header buttons */
@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .header-info {
        gap: 8px;
    }
    
    /* Favorites button - icon only */
    #favorites-btn {
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #favorites-btn::before {
        content: '⭐';
        font-size: 18px;
    }
    
    /* Pending devices button - icon only */
    #pending-devices-btn {
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #pending-devices-btn::before {
        content: '🔔';
        font-size: 18px;
    }
    
    #pending-devices-btn #pending-count-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        font-size: 10px;
        min-width: 18px;
        height: 18px;
        padding: 2px 4px;
    }
    
    /* Admin button - icon only */
    .admin-btn {
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
        gap: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .admin-btn::before {
        content: '👤';
        font-size: 18px;
    }
    
    .dropdown-arrow {
        display: none;
    }
    
    /* Admin dropdown positioning */
    .admin-dropdown-content {
        right: 0;
        min-width: 180px;
    }
    
    /* Hide user info text on mobile */
    #user-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 8px 12px;
    }
    
    .header h1 {
        font-size: 14px;
    }
    
    .header-info {
        gap: 6px;
    }
    
    #favorites-btn,
    #pending-devices-btn,
    .admin-btn {
        width: 32px;
        height: 32px;
    }
    
    #favorites-btn::before,
    #pending-devices-btn::before,
    .admin-btn::before {
        font-size: 16px;
    }
    
    #pending-devices-btn #pending-count-badge {
        font-size: 9px;
        min-width: 16px;
        height: 16px;
        padding: 2px 3px;
    }
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s;
}

.admin-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.admin-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: rgba(40, 40, 50, 0.4);
    backdrop-filter: blur(10px);
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-dropdown-content.show {
    display: block;
}

.admin-dropdown-content a {
    display: block;
    padding: 12px 20px;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.admin-dropdown-content a:hover {
    background: rgba(78, 204, 163, 0.15);
    color: #4ecca3;
    padding-left: 24px;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* Container */
.container {
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
    display: flex;
    /* Prevent mobile browser scrolling */
    touch-action: pan-x pan-y;
    overscroll-behavior: none;
}

/* Sidebar */
.sidebar {
    position: absolute;
    left: 15px;
    top: 15px;
    width: auto;
    min-width: 180px;
    max-width: 280px;
    max-height: calc(100vh - 95px);
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 1000;
    padding: 0;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(78, 204, 163, 0.3);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 204, 163, 0.5);
}

/* Mobile sidebar adaptation */
@media (max-width: 768px) {
    .sidebar {
        left: 10px;
        top: 70px;
        width: auto;
        max-width: 240px;
        max-height: calc(100vh - 200px);
        padding: 12px;
    }
    
    .sidebar::-webkit-scrollbar {
        width: 4px;
    }
    
    .section {
        margin-bottom: 20px;
    }
    
    .section h2 {
        font-size: 14px;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: auto;
        max-width: 160px;
        padding: 10px;
    }
    
    .section {
        margin-bottom: 16px;
    }
    
    .section h2 {
        font-size: 13px;
        margin-bottom: 6px;
    }
}

.section {
    margin-bottom: 30px;
}

.section h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #4ecca3;
    text-shadow: 0 1px 3px rgba(78, 204, 163, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    background: rgba(78, 204, 163, 0.2);
    border: 1px solid rgba(78, 204, 163, 0.3);
    color: #4ecca3;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Device List */
.device-list {
    display: flex;
    flex-direction: column;
    align-items: baseline;
    gap: 10px;
}

.device-item {
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.device-item:hover {
    background: rgba(25, 25, 35, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(78, 204, 163, 0.3);
}

.device-item.selected {
    border-color: #4ecca3;
    background: rgba(78, 204, 163, 0.1);
    box-shadow: 0 0 20px rgba(78, 204, 163, 0.2);
}

.device-item.offline {
    opacity: 0.5;
}

.device-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #e0e0e0;
}

.device-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.device-status .status-indicator {
    margin-right: 4px;
}

.device-status .speed,
.device-status .altitude,
.device-status .accuracy {
    font-size: 11px;
    color: #888;
}

.device-details-btn {
    margin-top: 8px;
    width: 100%;
    padding: 6px 10px;
    background: rgba(78, 204, 163, 0.2);
    border: 1px solid rgba(78, 204, 163, 0.3);
    border-radius: 6px;
    color: #4ecca3;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.device-details-btn:hover {
    background: rgba(78, 204, 163, 0.3);
    border-color: rgba(78, 204, 163, 0.5);
}

.status-online {
    color: #4ecca3;
    text-shadow: 0 0 5px rgba(78, 204, 163, 0.5);
}

.status-offline {
    color: #ef4444;
    text-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
}

/* Mobile adaptations for device list */
@media (max-width: 768px) {
    .device-list {
        gap: 8px;
    }
    
    .device-item {
        padding: 10px;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 5px 10px;
        border-width: 2px;
        border-radius: 10px;
    }
    
    /* Online devices - green glow border */
    .device-item:not(.offline) {
        border-color: rgba(78, 204, 163, 0.6);
        box-shadow: 
            0 0 10px rgba(78, 204, 163, 0.4),
            inset 0 0 10px rgba(78, 204, 163, 0.1);
        background: rgba(78, 204, 163, 0.08);
    }
    
    .device-item:not(.offline):hover {
        border-color: rgba(78, 204, 163, 0.8);
        box-shadow: 
            0 0 15px rgba(78, 204, 163, 0.6),
            inset 0 0 12px rgba(78, 204, 163, 0.15);
    }
    
    /* Offline devices - hide completely on mobile */
    .device-item.offline {
        display: none;
    }
    
    .device-name {
        font-size: 13px;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 600;
        grid-column: 1;
        grid-row: 1;
        align-self: center;
    }
    
    /* Selected device - green + orange glow (offline hidden anyway) */
    .device-item.selected {
        border-color: rgba(78, 204, 163, 0.8);
        box-shadow: 
            0 0 10px rgba(78, 204, 163, 0.5),
            0 0 20px rgba(255, 152, 0, 0.6),
            inset 0 0 10px rgba(78, 204, 163, 0.1),
            inset 0 0 15px rgba(255, 152, 0, 0.15);
        background: linear-gradient(135deg, rgba(78, 204, 163, 0.1), rgba(255, 152, 0, 0.1));
        transform: scale(1.02);
        animation: orangeGreenPulse 2s ease-in-out infinite;
    }
    
    .device-item.selected:hover {
        box-shadow: 
            0 0 15px rgba(78, 204, 163, 0.7),
            0 0 25px rgba(255, 152, 0, 0.8),
            inset 0 0 12px rgba(78, 204, 163, 0.15),
            inset 0 0 20px rgba(255, 152, 0, 0.2);
        animation: none;
    }
    
    .device-item.selected .device-name {
        color: #ff9800;
        text-shadow: 0 0 8px rgba(255, 152, 0, 0.5);
    }
    
    @keyframes orangeGreenPulse {
        0%, 100% {
            box-shadow: 
                0 0 10px rgba(78, 204, 163, 0.5),
                0 0 20px rgba(255, 152, 0, 0.6),
                inset 0 0 10px rgba(78, 204, 163, 0.1),
                inset 0 0 15px rgba(255, 152, 0, 0.15);
        }
        50% {
            box-shadow: 
                0 0 15px rgba(78, 204, 163, 0.6),
                0 0 30px rgba(255, 152, 0, 0.9),
                inset 0 0 12px rgba(78, 204, 163, 0.15),
                inset 0 0 20px rgba(255, 152, 0, 0.25);
        }
    }
    
    /* Status info in right column */
    .device-status {
        display: flex;
        flex-direction: column;
        gap: 3px;
        font-size: 10px;
        color: rgba(255, 255, 255, 0.7);
        font-weight: 600;
        line-height: 1.3;
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: center;
        text-align: right;
        white-space: nowrap;
    }
    
    /* Hide online/offline status text on mobile */
    .device-status .status-indicator {
        display: none;
    }
    
    /* Show only data in column on mobile */
    .device-status .speed,
    .device-status .altitude,
    .device-status .accuracy {
        display: block;
        color: rgba(255, 255, 255, 0.7);
    }
    
    /* Info button in left column, bottom */
    .device-details-btn {
        margin-top: 0;
        width: auto;
        height: auto;
        padding: 5px 12px;
        font-size: 11px;
        border-radius: 6px;
        display: inline-block;
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
    }
    
    .device-details-btn::before {
        content: '';
    }
}

@media (max-width: 480px) {
    .device-list {
        gap: 6px;
    }
    
    .device-item {
        padding: 8px;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 4px 8px;
    }
    
    .device-name {
        font-size: 12px;
        margin-bottom: 0;
        font-weight: 600;
        grid-column: 1;
        grid-row: 1;
        align-self: center;
    }
    
    /* Offline devices - hide completely on small screens */
    .device-item.offline {
        display: none;
    }
    
    /* Selected device - green + orange glow on small screens */
    .device-item.selected {
        border-color: rgba(78, 204, 163, 0.8);
        box-shadow: 
            0 0 8px rgba(78, 204, 163, 0.5),
            0 0 15px rgba(255, 152, 0, 0.6),
            inset 0 0 8px rgba(78, 204, 163, 0.1),
            inset 0 0 12px rgba(255, 152, 0, 0.15);
        background: linear-gradient(135deg, rgba(78, 204, 163, 0.1), rgba(255, 152, 0, 0.1));
        animation: orangeGreenPulse 2s ease-in-out infinite;
    }
    
    .device-item.selected .device-name {
        color: #ff9800;
        text-shadow: 0 0 6px rgba(255, 152, 0, 0.5);
    }
    
    /* Status info in right column - smaller */
    .device-status {
        display: flex;
        flex-direction: column;
        gap: 2px;
        font-size: 9px;
        color: rgba(255, 255, 255, 0.7);
        font-weight: 600;
        line-height: 1.3;
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: center;
        text-align: right;
        white-space: nowrap;
    }
    
    /* Hide online/offline status text on small mobile */
    .device-status .status-indicator {
        display: none;
    }
    
    /* Show only data in column on small mobile */
    .device-status .speed,
    .device-status .altitude,
    .device-status .accuracy {
        display: block;
        color: rgba(255, 255, 255, 0.7);
    }
    
    /* Info button in left column, bottom - smaller */
    .device-details-btn {
        margin-top: 0;
        padding: 4px 10px;
        font-size: 10px;
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
    }
}

/* Map Container */
.map-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    /* Allow clicks to pass through to map */
    pointer-events: none;
    /* Prevent scrolling on mobile */
    overflow: hidden;
}

/* Re-enable pointer events for interactive elements inside map-container */
.map-container > * {
    pointer-events: auto;
}

#map {
    width: 100%;
    height: 100%;
    /* Allow map to handle all touch gestures */
    touch-action: manipulation;
    /* Prevent pull-to-refresh */
    overscroll-behavior: contain;
}

/* Mobile-specific fixes for address bar hiding */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari */
    #map {
        height: -webkit-fill-available;
    }
    
    .map-container {
        height: -webkit-fill-available;
    }
    
    .container {
        height: -webkit-fill-available;
    }
}

/* Prevent any scrolling on mobile devices */
@media (max-width: 768px) {
    html, body {
        position: fixed;
        overflow: hidden;
        height: 100vh;
        width: 100vw;
    }
    
    #main-screen {
        position: fixed;
        height: 100vh;
        width: 100vw;
        overflow: hidden;
    }
    
    .map-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
}


/* Search Panel */
.search-panel {
    position: absolute;
    bottom: 230px;
    left: 35%;
    transform: translateX(-50%);
    width: 350px;
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    z-index: 1000;
    /* Allow clicks to pass through to map */
    pointer-events: none;
}

/* Enable pointer events only for interactive elements */
.search-panel .expandable-search-container,
.search-panel .route-end-container,
.search-panel .route-actions-container,
.search-panel button,
.search-panel input,
.search-panel .clear-btn {
    pointer-events: auto;
}

/* Mobile adaptations for search panel */
@media (max-width: 768px) {
    .search-panel {
        bottom: 360px;
        left: 30%;
        transform: translateX(-50%);
        width: calc(100vw - 40px);
        max-width: 320px;
        padding: 12px;
        border-radius: 12px;
    }
    
    .search-section {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    
    .search-header {
        padding: 6px;
    }
    
    .search-header h3 {
        font-size: 12px;
    }
    
    .toggle-icon {
        font-size: 11px;
    }
    
    .search-content {
        padding-top: 8px;
    }
    
    .search-input {
        padding: 8px 10px;
        font-size: 12px;
        margin-bottom: 6px;
        border-radius: 6px;
    }
    
    .expandable-search-container {
        width: 40px;
        height: 38px;
        margin-bottom: 8px;
    }
    
    .expandable-search-container::before {
        font-size: 16px;
        left: 12px;
    }
    
    .expandable-search {
        padding-left: 38px;
        padding-right: 30px;
    }
}

@media (max-width: 480px) {
    .search-panel {
        bottom: 340px;
        left: 33%;
        transform: translateX(-50%);
        width: calc(100vw - 30px);
        max-width: 280px;
        padding: 10px;
        border-radius: 10px;
    }
    
    .search-section {
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
    
    .search-header {
        padding: 5px;
    }
    
    .search-header h3 {
        font-size: 11px;
    }
    
    .toggle-icon {
        font-size: 10px;
    }
    
    .search-content {
        padding-top: 6px;
    }
    
    .search-input {
        padding: 7px 9px;
        font-size: 11px;
        margin-bottom: 5px;
        border-radius: 5px;
    }
    
    .expandable-search-container {
        width: 36px;
        height: 36px;
        margin-bottom: 6px;
    }
    
    .expandable-search-container::before {
        font-size: 14px;
        left: 10px;
    }
    
    .expandable-search {
        padding-left: 36px;
        padding-right: 28px;
    }
    
    .route-end-container.visible {
        max-height: 52px;
        margin-bottom: 6px;
    }
}

.search-section {
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
}

.search-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
}

.search-header:hover {
    background: rgba(78, 204, 163, 0.1);
}

.search-header h3 {
    color: #4ecca3;
    font-size: 14px;
    margin: 0;
    text-shadow: 0 1px 3px rgba(78, 204, 163, 0.3);
}

.toggle-icon {
    color: #4ecca3;
    font-size: 12px;
    transition: transform 0.3s;
    user-select: none;
}

.toggle-icon.rotated {
    transform: rotate(-90deg);
}

.search-content {
    padding-top: 12px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.search-content.hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #4ecca3;
    box-shadow: 0 0 0 3px rgba(78, 204, 163, 0.1);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Expandable Search Location */
.expandable-search-container {
    position: relative;
    width: 50px;
    height: 44px;
    margin-bottom: 10px;
    transition: width 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
}

.expandable-search-container.expanded {
    width: 100%;
    cursor: default;
}

.expandable-search-container::before {
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
    z-index: 2;
    transition: all 0.3s ease;
    opacity: 0.5;
    filter: grayscale(0.3) brightness(0.8);
}

.expandable-search-container.expanded::before {
    left: 12px;
    opacity: 0.6;
}

.expandable-search {
    padding-left: 44px;
    padding-right: 35px;
    width: 100%;
    transition: opacity 0.3s ease;
}

.expandable-search-container:not(.expanded) .expandable-search {
    opacity: 0;
    pointer-events: none;
}

.expandable-search-container.expanded .expandable-search {
    opacity: 1;
    pointer-events: all;
}

.expandable-search-container:not(.expanded) {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expandable-search-container:not(.expanded):hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(78, 204, 163, 0.3);
    box-shadow: 0 0 0 3px rgba(78, 204, 163, 0.05);
}

.expandable-search-container:not(.expanded) .clear-btn {
    display: none;
}

/* Route Start - use map icon instead of search */
#route-start-container::before {
    content: '🗺️';
    opacity: 0.5;
    filter: grayscale(0.3) brightness(0.8);
}

#route-start-container.expanded::before {
    opacity: 0.6;
}

/* Route End Container - Smooth appearance */
.route-end-container {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.route-end-container.visible {
    max-height: 60px;
    opacity: 1;
    margin-bottom: 10px;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Route Action Buttons - Appear when route end has value */
.route-actions-container {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.route-actions-container.visible {
    max-height: 45px;
    opacity: 1;
    margin-top: 8px;
    animation: slideDown 0.4s ease-out;
}

.btn-route-start {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(78, 204, 163, 0.2);
    border: 1px solid rgba(78, 204, 163, 0.3);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #4ecca3;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-route-start:hover:not(:disabled) {
    background: rgba(78, 204, 163, 0.3);
    border-color: rgba(78, 204, 163, 0.5);
}

.btn-route-start:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-route-start .btn-icon {
    font-size: 14px;
}

.btn-route-favorite {
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff9800;
    flex-shrink: 0;
}

.btn-route-favorite:hover:not(:disabled) {
    background: rgba(255, 152, 0, 0.3);
    border-color: rgba(255, 152, 0, 0.5);
}

.btn-route-favorite:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Google Places Autocomplete dropdown styling */
.pac-container {
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
}

.pac-item {
    color: #e0e0e0;
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.pac-item:first-child {
    border-top: none;
}

.pac-item:hover {
    background: rgba(78, 204, 163, 0.1);
}

.pac-item-query {
    color: #4ecca3;
    font-weight: 600;
}

.pac-icon {
    background-image: none;
}

.pac-icon::before {
    content: "📍";
    font-size: 16px;
}

/* Controls Panel */
.controls-panel {

    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    right: auto;
    width: auto;
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 1000;
    padding: 0;
    display: flex;
    gap: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.controls-panel button {
    margin: 0;
    width: auto;
    min-width: 150px;
}

.input-with-clear {
    position: relative;
}

.input-with-clear .search-input {
    padding-right: 35px;
}

.input-with-clear .clear-btn {
    position: absolute;
    right: 10px;
    top: 40%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 18px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
}

.input-with-clear .clear-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    opacity: 1;
    transform: translateY(-50%) scale(1.15);
}

/* Mobile adaptations for controls panel */
@media (max-width: 768px) {
    .controls-panel {
        bottom: max(170px, env(safe-area-inset-bottom, 10px));
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        width: auto;
        left: 50%;
        transform: translateX(-50%);
        padding: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        border-left: none;
        border-top: none;
        background: transparent;
    }
    
    .controls-panel button {
        min-width: 0;
    }
    
    .controls-panel .btn {
        width: 48px;
        height: 48px;
        min-width: 48px;
        padding: 0;
        font-size: 0;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(20, 20, 30, 0.85);
        backdrop-filter: blur(10px);
        border: 2px solid;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        flex-shrink: 0;
        position: relative;
        overflow: visible;
        transition: all 0.2s ease;
    }
    
    /* Show only emoji with ::after */
    .controls-panel #apply-location-btn::after {
        content: '📍';
        position: absolute;
        font-size: 24px;
        color: #4ecca3;
    }
    
    .controls-panel #start-route-btn::after {
        content: '🗺️';
        position: absolute;
        font-size: 24px;
        color: #4caf50;
    }
    
    .controls-panel #stop-selected-btn::after {
        content: '⏹';
        position: absolute;
        font-size: 24px;
        color: #ff9800;
    }
    
    .controls-panel #favorites-btn::after {
        content: '⭐';
        position: absolute;
        font-size: 24px;
        color: #ff9800;
    }
    
    /* Button-specific colors */
    .controls-panel .btn-primary {
        border-color: rgba(78, 204, 163, 0.5);
    }
    
    .controls-panel .btn-primary:not(:disabled):active,
    .controls-panel .btn-primary:not(:disabled):hover {
        background: rgba(78, 204, 163, 0.3);
        border-color: rgba(78, 204, 163, 0.8);
        transform: scale(1.05);
    }
    
    .controls-panel .btn-success {
        border-color: rgba(76, 175, 80, 0.5);
    }
    
    .controls-panel .btn-success:not(:disabled):active,
    .controls-panel .btn-success:not(:disabled):hover {
        background: rgba(76, 175, 80, 0.3);
        border-color: rgba(76, 175, 80, 0.8);
        transform: scale(1.05);
    }
    
    .controls-panel .btn-warning {
        border-color: rgba(255, 152, 0, 0.5);
    }
    
    .controls-panel .btn-warning:not(:disabled):active,
    .controls-panel .btn-warning:not(:disabled):hover {
        background: rgba(255, 152, 0, 0.3);
        border-color: rgba(255, 152, 0, 0.8);
        transform: scale(1.05);
    }
    
    /* Disabled state */
    .controls-panel .btn:disabled::after {
        opacity: 0.3;
        filter: grayscale(1);
    }
    
    .controls-panel .btn:disabled {
        background: rgba(20, 20, 30, 0.5);
        border-color: rgba(255, 255, 255, 0.2);
        transform: none;
    }
    
    /* Active/enabled pulse effect */
    .controls-panel .btn:not(:disabled) {
        animation: subtlePulse 2s ease-in-out infinite;
    }
    
    @keyframes subtlePulse {
        0%, 100% {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        }
        50% {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(78, 204, 163, 0.4);
        }
    }
    
    /* Remove animation on press */
    .controls-panel .btn:not(:disabled):active {
        animation: none;
    }
}

@media (max-width: 480px) {
    .controls-panel {
        bottom: max(170px, calc(20px + env(safe-area-inset-bottom, 20px)));
        padding: 8px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        gap: 6px;
    }
    
    .controls-panel .btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }
    
    .controls-panel #apply-location-btn::after,
    .controls-panel #start-route-btn::after,
    .controls-panel #stop-selected-btn::after,
    .controls-panel #favorites-btn::after {
        font-size: 22px;
    }
}

.panel-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h3 {
    color: #4ecca3;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4ecca3;
    box-shadow: 0 0 0 3px rgba(78, 204, 163, 0.1);
    background: rgba(0, 0, 0, 0.4);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

.selected-devices-list {
    min-height: 40px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.selected-device-tag {
    display: inline-block;
    background: rgba(78, 204, 163, 0.15);
    border: 1px solid rgba(78, 204, 163, 0.3);
    color: #4ecca3;
    padding: 6px 12px;
    border-radius: 6px;
    margin: 4px;
    font-size: 12px;
}

.selected-device-tag .remove {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    opacity: 0.7;
}

.selected-device-tag .remove:hover {
    opacity: 1;
}

/* Buttons */
button {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: rgba(78, 204, 163, 0.2);
    border: 1px solid rgba(78, 204, 163, 0.3);
    color: #4ecca3;
}

.btn-primary:hover:not(:disabled) {
    background: rgba(78, 204, 163, 0.3);
    border-color: rgba(78, 204, 163, 0.5);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

.btn-success:hover:not(:disabled) {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
}

.btn-success:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-danger:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-warning {
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ff9800;
}

.btn-warning:hover:not(:disabled) {
    background: rgba(255, 152, 0, 0.25);
    border-color: rgba(255, 152, 0, 0.4);
}

.btn-warning:active:not(:disabled) {
    background: linear-gradient(135deg, #ffc107, #e0a800) !important;
    border-color: rgba(255, 193, 7, 0.8) !important;
    color: #212529 !important;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.6) !important;
    transform: scale(0.98);
}

.btn-warning:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(150, 150, 150, 0.2);
    border: 1px solid rgba(150, 150, 150, 0.3);
    color: #9e9e9e;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(150, 150, 150, 0.3);
    border-color: rgba(150, 150, 150, 0.5);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

button:disabled {
    cursor: not-allowed;
}

/* Selected Devices */
.selected-devices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}

.selected-device-tag {
    background: #533483;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.selected-device-tag .remove {
    cursor: pointer;
    font-weight: bold;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f3460;
}

::-webkit-scrollbar-thumb {
    background: #533483;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b46a8;
}

/* Device Details Panel - Dark Theme */
/* Device Details Panel - Drawer Style */
.device-details-panel {
    position: fixed;
    top: 100px;
    right: 20px;
    bottom: 100px;
    width: 450px;
    background: rgba(25, 25, 35, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: 
        -8px 0 40px rgba(0, 0, 0, 0.6),
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(78, 204, 163, 0.15) inset;
    z-index: 1200;
    overflow: hidden;
    transform: translateX(150%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.device-details-panel.hidden {
    transform: translateX(150%);
    pointer-events: none;
}

.device-details-panel:not(.hidden) {
    transform: translateX(0);
    pointer-events: auto;
}

/* Responsive width for smaller screens */
@media (max-width: 768px) {
    .device-details-panel {
        top: 80px;
        right: 15px;
        bottom: 80px;
        width: 320px;
        max-width: calc(100vw - 30px);
        border-radius: 18px;
        transform: translateX(150%);
    }
    
    .device-details-panel.hidden {
        transform: translateX(150%);
    }
    
    .device-details-panel:not(.hidden) {
        transform: translateX(0);
    }
}

@media (max-width: 480px) {
    .device-details-panel {
        width: 280px;
        max-width: calc(100vw - 25px);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .device-details-panel {
        width: 400px;
        top: 90px;
        right: 15px;
        bottom: 90px;
    }
}

@media (min-width: 1025px) and (max-width: 1399px) {
    .device-details-panel {
        width: 450px;
        top: 100px;
        right: 20px;
        bottom: 100px;
    }
}

@media (min-width: 1400px) {
    .device-details-panel {
        width: 500px;
        top: 110px;
        right: 25px;
        bottom: 110px;
    }
}

.device-details-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 20px;
    background: rgba(30, 30, 40, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    position: relative;
}

/* Top accent line */
.device-details-panel .panel-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(78, 204, 163, 0.6), 
        transparent);
    border-radius: 2px;
}

/* Swipe indicator for mobile */
.device-details-panel .panel-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    display: none;
}

@media (max-width: 768px) {
    .device-details-panel .panel-header::before {
        display: block;
        z-index: 2;
        top: 6px;
    }
    
    .device-details-panel .panel-header {
        padding-top: 20px;
    }
    
    .device-details-panel .panel-header::after {
        top: 12px;
    }
}

@media (max-width: 480px) {
    .device-details-panel .panel-header {
        padding-top: 18px;
    }
}

.device-details-panel .panel-header h3 {
    margin: 0;
    font-size: 16px;
    color: #4ecca3;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(78, 204, 163, 0.3);
    letter-spacing: 0.5px;
}

.device-details-panel .device-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.device-details-panel .close-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-size: 22px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.device-details-panel .close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: rotate(90deg);
}

/* Compact mobile styles */
@media (max-width: 768px) {
    .device-details-panel .close-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .device-details-panel .panel-header {
        padding: 14px 16px;
    }
    
    .device-details-panel .panel-header h3 {
        font-size: 13px;
    }
    
    .device-details-panel .device-info {
        font-size: 10px;
    }
    
    .device-details-panel .panel-content {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .device-details-panel .panel-header h3 {
        font-size: 12px;
    }
    
    .device-details-panel .panel-content {
        padding: 12px;
    }
}

.device-details-panel .panel-content {
    padding: 1px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Dark Scrollbar for panel content */
.device-details-panel .panel-content::-webkit-scrollbar {
    width: 6px;
}

.device-details-panel .panel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.device-details-panel .panel-content::-webkit-scrollbar-thumb {
    background: rgba(78, 204, 163, 0.3);
    border-radius: 10px;
}

.device-details-panel .panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 204, 163, 0.5);
}

/* Device Details Tabs */
.device-details-tabs {
    display: flex;
    gap: 1px;
    background: rgba(30, 30, 40, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.device-tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 4px 4px;
    font-size: 28px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    flex: 1;
    min-width: 0;
}

/* Mobile-friendly tabs */
@media (max-width: 768px) {
    .device-tab-btn {
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .device-details-tabs {
        padding: 0 8px;
    }
}

@media (max-width: 480px) {
    .device-tab-btn {
        padding: 9px 8px;
        font-size: 10px;
    }
}

.device-tab-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.device-tab-btn.active {
    color: #4ecca3;
    border-bottom-color: #4ecca3;
    text-shadow: 0 0 10px rgba(78, 204, 163, 0.5);
}

/* Device Tab Panels */
.device-tabs-content {
    position: relative;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.device-tab-panel {
    display: none;
    flex: 1;
    overflow: hidden;
}

.device-tab-panel.active {
    display: flex;
    flex-direction: column;
}

/* Glass Select and Input Styles */
.glass-select {
    background: rgba(30, 30, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
    max-width: 100%;
}

/* Compact selects in narrow panel */
.device-details-panel .glass-select {
    font-size: 11px;
    padding: 5px 8px;
    min-width: 90px;
}

@media (max-width: 768px) {
    .device-details-panel .glass-select {
        font-size: 10px;
        padding: 4px 6px;
        min-width: 80px;
    }
}

.glass-select:hover {
    border-color: rgba(78, 204, 163, 0.5);
    background: rgba(35, 35, 45, 0.9);
}

.glass-select:focus {
    outline: none;
    border-color: #4ecca3;
    box-shadow: 0 0 10px rgba(78, 204, 163, 0.3);
}

.glass-input-small {
    background: rgba(30, 30, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #e0e0e0;
    padding: 3px 5px;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.3s;
    width: 65px;
    max-width: 100%;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}

/* Remove spinner arrows on number inputs */
.glass-input-small::-webkit-outer-spin-button,
.glass-input-small::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Ultra compact inputs in narrow panel */
.device-details-panel .glass-input-small {
    width: 55px;
    padding: 2px 4px;
    font-size: 9px;
    border-radius: 3px;
}

@media (max-width: 768px) {
    .device-details-panel .glass-input-small {
        width: 50px;
        font-size: 8px;
        padding: 2px 3px;
    }
}

.glass-input-small:hover {
    border-color: rgba(78, 204, 163, 0.5);
}

.glass-input-small:focus {
    outline: none;
    border-color: #4ecca3;
    box-shadow: 0 0 8px rgba(78, 204, 163, 0.3);
    background: rgba(35, 35, 45, 0.9);
}

/* Monitoring Controls */
.monitoring-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 15px 18px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.status-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: #999;
    letter-spacing: 0.5px;
}

.monitoring-data {
    padding: 15px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 600;
}

/* Button Sizes */
.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
}

/* Compact buttons in narrow panel */
.device-details-panel .btn-sm {
    padding: 5px 8px;
    font-size: 10px;
}

@media (max-width: 768px) {
    .device-details-panel .btn-sm {
        padding: 4px 6px;
        font-size: 9px;
    }
}

/* 2 Column Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

/* Single column for narrow panels with ultra compact gaps */
.device-details-panel .cards-grid {
    gap: 6px;
}

@media (max-width: 768px) {
    .device-details-panel .cards-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* Physics Settings grids - even more compact */
.device-details-panel details .cards-grid {
    gap: 4px;
    margin-bottom: 6px;
}

@media (max-width: 768px) {
    .device-details-panel details .cards-grid {
        gap: 3px;
        margin-bottom: 4px;
    }
}

/* Force single column when panel is in narrow mode */
.device-details-panel[style*="width: 450px"] .cards-grid,
.device-details-panel[style*="width: 400px"] .cards-grid,
.device-details-panel[style*="width: 320px"] .cards-grid,
.device-details-panel[style*="width: 280px"] .cards-grid {
    grid-template-columns: 1fr;
}

/* Dark Glass Card */
.info-card {
    background: rgba(40, 40, 50, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s;
    overflow-x: auto;
    position: relative;
}

/* Hide scrollbar but keep functionality */
.device-details-panel .info-card::-webkit-scrollbar {
    height: 4px;
}

.device-details-panel .info-card::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.device-details-panel .info-card::-webkit-scrollbar-thumb {
    background: rgba(78, 204, 163, 0.3);
    border-radius: 2px;
}

.device-details-panel .info-card::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 204, 163, 0.5);
}

/* Minimum width for wide tables in Physics Settings - more compact */
.device-details-panel .info-card [style*="grid-template-columns"] {
    min-width: 360px;
}

@media (max-width: 768px) {
    .device-details-panel .info-card [style*="grid-template-columns"] {
        min-width: 320px;
    }
}

/* Ultra compact padding for table containers */
.device-details-panel .info-card > div[style*="padding: 12px"] {
    padding: 4px;
}

@media (max-width: 768px) {
    .device-details-panel .info-card > div[style*="padding: 12px"] {
        padding: 3px;
    }
}

/* Remove padding from nested physics containers */
.device-details-panel details .info-card > div {
    padding: 4px;
}

@media (max-width: 768px) {
    .device-details-panel details .info-card > div {
        padding: 3px;
    }
}

/* Ultra compact table gaps */
.device-details-panel [style*="grid-template-columns"][style*="gap: 10px"] {
    gap: 3px;
}

@media (max-width: 768px) {
    .device-details-panel [style*="grid-template-columns"][style*="gap: 10px"] {
        gap: 2px;
    }
}

/* Ultra compact table rows */
.device-details-panel [style*="grid-template-columns"] > div[style*="padding: 8px 0"] {
    padding: 3px 0;
}

@media (max-width: 768px) {
    .device-details-panel [style*="grid-template-columns"] > div[style*="padding: 8px 0"] {
        padding: 2px 0;
    }
}

/* Compact table headers */
.device-details-panel [style*="grid-template-columns"] [style*="font-weight: 600"] {
    font-size: 9px;
}

@media (max-width: 768px) {
    .device-details-panel [style*="grid-template-columns"] [style*="font-weight: 600"] {
        font-size: 8px;
    }
}

/* Ultra compact input widths in tables */
.device-details-panel [style*="grid-template-columns"] .glass-input-small[style*="width: 100px"] {
    width: 60px;
}

.device-details-panel [style*="grid-template-columns"] .glass-input-small[style*="width: 80px"] {
    width: 50px;
}

.device-details-panel [style*="grid-template-columns"] .glass-input-small[style*="width: 70px"] {
    width: 45px;
}

@media (max-width: 768px) {
    .device-details-panel [style*="grid-template-columns"] .glass-input-small[style*="width: 100px"] {
        width: 55px;
    }
    
    .device-details-panel [style*="grid-template-columns"] .glass-input-small[style*="width: 80px"] {
        width: 45px;
    }
    
    .device-details-panel [style*="grid-template-columns"] .glass-input-small[style*="width: 70px"] {
        width: 40px;
    }
}

/* Ultra compact Advanced Physics Settings section */
.device-details-panel details {
    margin-top: 4px;
}

.device-details-panel details[style*="margin-top: 10px"] {
    margin-top: 4px;
}

.device-details-panel details > div[style*="margin-top: 15px"] {
    margin-top: 4px;
}

@media (max-width: 768px) {
    .device-details-panel details {
        margin-top: 3px;
    }
    
    .device-details-panel details > div[style*="margin-top: 15px"] {
        margin-top: 3px;
    }
}

/* Visual hint for scrollable tables - subtle fade on edges */
.device-details-panel .info-card:has([style*="grid-template-columns"])::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to left, rgba(40, 40, 50, 0.8), transparent);
    pointer-events: none;
    z-index: 1;
}

@media (min-width: 1400px) {
    .device-details-panel .info-card:has([style*="grid-template-columns"])::before {
        display: none;
    }
}

/* Physics Section - lightweight, no heavy borders */
.physics-section {
    background: rgba(20, 20, 30, 0.3);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 6px;
}

.physics-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(78, 204, 163, 0.15);
}

.physics-section-header .card-icon {
    font-size: 13px;
}

.physics-section-header .card-title {
    color: #4ecca3;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .physics-section {
        padding: 6px;
        margin-bottom: 4px;
    }
    
    .physics-section-header {
        gap: 4px;
        margin-bottom: 4px;
        padding-bottom: 3px;
    }
    
    .physics-section-header .card-icon {
        font-size: 12px;
    }
    
    .physics-section-header .card-title {
        font-size: 9px;
    }
}

/* Ultra compact margins in Physics Settings cards */
.device-details-panel .info-card[style*="margin-top: 15px"] {
    margin-top: 4px;
}

@media (max-width: 768px) {
    .device-details-panel .info-card[style*="margin-top: 15px"] {
        margin-top: 3px;
    }
}

/* General margin-top reduction */
.device-details-panel [style*="margin-top: 5px"] {
    margin-top: 2px;
}

.device-details-panel [style*="margin-top: 10px"]:not(.info-card) {
    margin-top: 4px;
}

@media (max-width: 768px) {
    .device-details-panel [style*="margin-top: 10px"]:not(.info-card) {
        margin-top: 3px;
    }
}

/* Ultra compact Turn Behavior and other nested sections */
.device-details-panel [style*="margin-top: 12px"][style*="padding: 10px"] {
    margin-top: 4px;
    padding: 4px;
}

@media (max-width: 768px) {
    .device-details-panel [style*="margin-top: 12px"][style*="padding: 10px"] {
        margin-top: 3px;
        padding: 3px;
    }
}

/* Ultra compact nested grids */
.device-details-panel [style*="padding: 8px; border-radius: 6px"] {
    padding: 4px;
}

@media (max-width: 768px) {
    .device-details-panel [style*="padding: 8px; border-radius: 6px"] {
        padding: 3px;
    }
}

/* Ultra compact nested containers in physics */
.device-details-panel [style*="padding: 10px; border-radius: 8px"] {
    padding: 4px;
}

@media (max-width: 768px) {
    .device-details-panel [style*="padding: 10px; border-radius: 8px"] {
        padding: 3px;
    }
}

/* Ultra compact nested titles */
.device-details-panel [style*="margin-bottom: 8px"][style*="font-weight: 600"] {
    margin-bottom: 3px;
}

@media (max-width: 768px) {
    .device-details-panel [style*="margin-bottom: 8px"][style*="font-weight: 600"] {
        margin-bottom: 2px;
    }
}

/* Compact preset buttons section */
.device-details-panel > div[style*="margin-top: 20px"][style*="padding: 15px"] {
    margin-top: 12px;
    padding: 10px;
    gap: 6px;
}

@media (max-width: 768px) {
    .device-details-panel > div[style*="margin-top: 20px"][style*="padding: 15px"] {
        margin-top: 10px;
        padding: 8px;
        gap: 4px;
    }
}

/* Compact preset buttons label */
.device-details-panel [style*="margin-right: 10px"][style*="font-size: 12px"] {
    margin-right: 6px;
    font-size: 10px;
}

@media (max-width: 768px) {
    .device-details-panel [style*="margin-right: 10px"][style*="font-size: 12px"] {
        margin-right: 4px;
        font-size: 9px;
    }
}

/* Radical compact mode for device panel */
.device-details-panel .info-card {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .device-details-panel .info-card {
        padding: 8px 10px;
        border-radius: 8px;
        margin-bottom: 6px;
    }
}

@media (max-width: 480px) {
    .device-details-panel .info-card {
        padding: 6px 8px;
        border-radius: 6px;
    }
}

/* Remove extra spacing in Physics Settings */
.device-details-panel details .info-card {
    padding: 8px 10px;
    margin-bottom: 6px;
}

@media (max-width: 768px) {
    .device-details-panel details .info-card {
        padding: 6px 8px;
        margin-bottom: 4px;
    }
}

.info-card:hover {
    background: rgba(50, 50, 60, 0.6);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(78, 204, 163, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ultra compact card headers in narrow panel */
.device-details-panel .card-header {
    gap: 4px;
    margin-bottom: 6px;
    padding-bottom: 4px;
}

@media (max-width: 768px) {
    .device-details-panel .card-header {
        gap: 3px;
        margin-bottom: 4px;
        padding-bottom: 3px;
    }
}

.card-icon {
    font-size: 15px;
}

.device-details-panel .card-icon {
    font-size: 13px;
}

@media (max-width: 768px) {
    .device-details-panel .card-icon {
        font-size: 12px;
    }
}

.card-title {
    color: #4ecca3;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(78, 204, 163, 0.3);
}

.device-details-panel .card-title {
    font-size: 10px;
    letter-spacing: 0.6px;
}

@media (max-width: 768px) {
    .device-details-panel .card-title {
        font-size: 9px;
        letter-spacing: 0.4px;
    }
}

/* Scrollable List for Cell Towers & WiFi Networks */
.scrollable-list {
    max-height: 130px;
    overflow-y: auto;
    padding-right: 5px;
}

.scrollable-list::-webkit-scrollbar {
    width: 4px;
}

.scrollable-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.scrollable-list::-webkit-scrollbar-thumb {
    background: rgba(78, 204, 163, 0.4);
    border-radius: 4px;
}

.scrollable-list::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 204, 163, 0.6);
}

/* Data Items */
.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    flex-shrink: 0;
}

.device-details-panel .info-label {
    font-size: 9px;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .device-details-panel .info-label {
        font-size: 8px;
        letter-spacing: 0.3px;
    }
}

.info-value {
    color: #e0e0e0;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    text-align: right;
    max-width: 60%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 2px 0;
}

.device-details-panel .info-value {
    font-size: 11px;
}

@media (max-width: 768px) {
    .device-details-panel .info-value {
        font-size: 10px;
    }
}

/* Compact text elements in narrow panel */
.device-details-panel small,
.device-details-panel details summary {
    font-size: 10px;
}

@media (max-width: 768px) {
    .device-details-panel small,
    .device-details-panel details summary {
        font-size: 9px;
    }
}

/* Compact inline styles overrides */
.device-details-panel [style*="font-size: 11px"] {
    font-size: 10px;
}

.device-details-panel [style*="font-size: 12px"] {
    font-size: 11px;
}

.device-details-panel [style*="font-size: 13px"] {
    font-size: 11px;
}

@media (max-width: 768px) {
    .device-details-panel [style*="font-size: 11px"],
    .device-details-panel [style*="font-size: 12px"] {
        font-size: 9px;
    }
    
    .device-details-panel [style*="font-size: 13px"] {
        font-size: 10px;
    }
}

/* Horizontal scrollbar for long values (Kernel, Android ID) */
.info-value::-webkit-scrollbar {
    height: 3px;
}

.info-value::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.info-value::-webkit-scrollbar-thumb {
    background: rgba(78, 204, 163, 0.4);
    border-radius: 3px;
}

.info-value.success {
    color: #4ecca3;
    text-shadow: 0 0 10px rgba(78, 204, 163, 0.5);
}

.info-value.warning {
    color: #ffa500;
    text-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

.info-value.danger {
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Setting Row */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Compact rows in narrow panel */
.device-details-panel .setting-row {
    padding: 8px 0;
    gap: 8px;
}

@media (max-width: 768px) {
    .device-details-panel .setting-row {
        padding: 6px 0;
        gap: 6px;
    }
}

.setting-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Smaller labels in narrow panel */
.device-details-panel .setting-label {
    font-size: 9px;
    letter-spacing: 0.3px;
}

@media (max-width: 768px) {
    .device-details-panel .setting-label {
        font-size: 8px;
    }
}

/* Inline Slider */
.inline-slider {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
}

.inline-slider-track {
    position: relative;
    flex: 1;
    height: 26px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    user-select: none;
    overflow: hidden;
}

.inline-slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #4ecca3, #3eb489);
    border-radius: 13px;
    transition: width 0.05s;
    pointer-events: none;
}

.inline-slider-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    cursor: grab;
    transition: left 0.05s;
    pointer-events: none;
}

.inline-slider-thumb:active {
    cursor: grabbing;
}

.inline-slider-value {
    color: #e0e0e0;
    font-size: 11px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    min-width: 40px;
    text-align: right;
}

.inline-slider-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.slider-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: #4ecca3;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 10;
    border: 1px solid rgba(78, 204, 163, 0.3);
}

.inline-slider-track:hover .slider-tooltip {
    opacity: 1;
}

/* Dark Glass Select */
.glass-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    outline: none;
    transition: all 0.3s;
    cursor: pointer;
}

.glass-select:hover,
.glass-select:focus {
    background: rgba(0, 0, 0, 0.6);
    border-color: #4ecca3;
    box-shadow: 0 0 0 3px rgba(78, 204, 163, 0.1);
}

.glass-select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Dark Toggle */
.compact-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 25px;
}

.compact-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    transition: 0.4s;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 17px;
    width: 17px;
    left: 3px;
    bottom: 3px;
    background: #555;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.compact-toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #4ecca3, #3eb489);
}

.compact-toggle input:checked + .toggle-slider:before {
    transform: translateX(21px);
    background: white;
}

/* Toggle Switch (for Frida settings) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 25px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #4ecca3, #3eb489);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(21px);
    background: white;
}

/* Note text */
.note-text {
    font-size: 10px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.4);
}

/* Legacy support for old classes */
.setting-select {
    background-color: rgba(0, 0, 0, 0.4);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.setting-select:hover,
.setting-select:focus {
    border-color: #4ecca3;
}

.setting-input {
    background-color: rgba(0, 0, 0, 0.4);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    width: 80px;
    text-align: right;
    outline: none;
    transition: border-color 0.2s;
}

.setting-input:hover,
.setting-input:focus {
    border-color: #4ecca3;
}

.setting-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 25px;
}

.setting-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.setting-toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #4ecca3, #3eb489);
}

.setting-toggle input:focus + .toggle-slider {
    box-shadow: 0 0 1px #4ecca3;
}

.setting-toggle input:checked + .toggle-slider:before {
    transform: translateX(21px);
    background: white;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #2d2d2d;
    color: #eee;
    padding: 12px 20px;
    border-radius: 6px;
    border-left: 4px solid #4ecca3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 10000;
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast.toast-success {
    border-left-color: #4ecca3;
}

.toast.toast-error {
    border-left-color: #e94560;
}

.toast.toast-warning {
    border-left-color: #ffa500;
}

.toast.toast-info {
    border-left-color: #4a9eff;
}

/* Google Maps Controls Styling */
.gm-style .gm-style-mtc {
    background: rgba(20, 20, 30, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(78, 204, 163, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin: 0 10px 10px 0;
}

.gm-style .gm-style-mtc > div {
    background: transparent;
}

.gm-style .gm-style-mtc button {
    background: rgba(20, 20, 30, 0.95);
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border: none;
    border-right: 1px solid rgba(78, 204, 163, 0.2);
    transition: all 0.2s ease;
}

.gm-style .gm-style-mtc button:last-child {
    border-right: none;
}

.gm-style .gm-style-mtc button:hover {
    background: rgba(78, 204, 163, 0.2);
    color: #4ecca3;
}

.gm-style .gm-style-mtc button[aria-pressed="true"] {
    background: linear-gradient(135deg, rgba(78, 204, 163, 0.3), rgba(78, 204, 163, 0.2));
    color: #4ecca3;
    box-shadow: inset 0 2px 10px rgba(78, 204, 163, 0.3);
}

/* Custom Labels Toggle Button */
.labels-toggle-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(78, 204, 163, 0.3);
    border-radius: 8px;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1;
    margin-right: 220px;
}

.labels-toggle-btn:hover {
    background: rgba(78, 204, 163, 0.2);
    color: #4ecca3;
    border-color: rgba(78, 204, 163, 0.5);
}

.labels-toggle-btn.active {
    background: rgba(78, 204, 163, 0.2);
    color: #4ecca3;
    border-color: rgba(78, 204, 163, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Map Settings Panel */
.map-settings-panel {
    position: absolute;
    bottom: 50px;
    right: 10px;
    background: rgba(40, 40, 50, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    min-width: 220px;
    max-width: 240px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 2;
    display: none;
    transition: all 0.3s;
}

.map-settings-panel.visible {
    display: block;
}

.map-settings-section {
    margin-bottom: 16px;
}

.map-settings-section:last-child {
    margin-bottom: 0;
}

.map-settings-title {
    color: #4ecca3;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-type-buttons {
    display: flex;
    gap: 8px;
}

.map-type-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e0e0e0;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-type-btn:hover {
    background: rgba(78, 204, 163, 0.1);
    border-color: rgba(78, 204, 163, 0.3);
}

.map-type-btn.active {
    background: rgba(78, 204, 163, 0.2);
    border-color: rgba(78, 204, 163, 0.5);
    color: #4ecca3;
}

.map-checkbox {
    display: flex;
    align-items: center;
    padding: 6px 0;
    cursor: pointer;
    user-select: none;
}

.map-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #4ecca3;
}

.map-checkbox label {
    color: #e0e0e0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}


@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============ Modules Tab Styles ============ */

.modules-manager {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1a1a2e;
}

.module-controls {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: rgba(30, 30, 40, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.module-search {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e0e0e0;
    padding: 8px 12px;
    font-size: 13px;
    transition: all 0.2s;
}

.module-search:focus {
    outline: none;
    border-color: rgba(156, 39, 176, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.module-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.module-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.module-card:hover {
    background: rgba(156, 39, 176, 0.05);
    border-color: rgba(156, 39, 176, 0.2);
}

.module-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.module-icon {
    width: 48px;
    height: 48px;
    background: rgba(156, 39, 176, 0.2);
    border: 1px solid rgba(156, 39, 176, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.module-icon.enabled {
    background: rgba(156, 39, 176, 0.3);
    border-color: rgba(156, 39, 176, 0.5);
}

.module-icon.disabled {
    background: rgba(100, 100, 100, 0.2);
    border-color: rgba(100, 100, 100, 0.3);
    opacity: 0.6;
}

.module-info {
    flex: 1;
    min-width: 0;
}

.module-name {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-word;
}

.module-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: #94a3b8;
    font-size: 11px;
    margin-bottom: 4px;
}

.module-description {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 6px;
    word-break: break-word;
}

.module-status {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-warning {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.status-info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.module-toggle-container {
    flex-shrink: 0;
}

.module-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.module-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.module-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(100, 100, 100, 0.3);
    transition: 0.3s;
    border-radius: 24px;
}

.module-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.module-switch input:checked + .module-slider {
    background-color: rgba(156, 39, 176, 0.5);
}

.module-switch input:checked + .module-slider:before {
    transform: translateX(20px);
}

.module-card-actions {
    display: flex;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.module-card-actions .btn-sm {
    flex: 1;
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}

.module-card-actions .btn-sm:hover {
    background: rgba(156, 39, 176, 0.2);
    border-color: rgba(156, 39, 176, 0.4);
    color: #9c27b0;
}

.module-card-actions .btn-sm.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.module-card-actions .btn-sm.btn-info:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #3b82f6;
}

.module-card-actions .btn-sm.btn-primary:hover {
    background: rgba(156, 39, 176, 0.2);
    border-color: rgba(156, 39, 176, 0.4);
    color: #9c27b0;
}

.module-card-actions .btn-sm.btn-purple:hover {
    background: rgba(156, 39, 176, 0.2);
    border-color: rgba(156, 39, 176, 0.4);
    color: #9c27b0;
}

.module-card-actions .btn-sm.btn-blue:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #3b82f6;
}

/* ============ Module Modals ============ */

.module-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.module-modal {
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.module-modal-large {
    max-width: 800px;
}

.module-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.module-modal-header h3 {
    margin: 0;
    color: #e2e8f0;
    font-size: 18px;
    font-weight: 600;
}

.module-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.module-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.module-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* ============ Reboot Menu ============ */

.reboot-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.reboot-option:hover {
    background: rgba(156, 39, 176, 0.1);
    border-color: rgba(156, 39, 176, 0.3);
}

.reboot-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(156, 39, 176, 0.2);
    border-radius: 8px;
    flex-shrink: 0;
}

.reboot-info {
    flex: 1;
}

.reboot-title {
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.reboot-desc {
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.4;
}

.reboot-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 12px 0;
}

/* ============ Profile Manager ============ */

.profile-controls {
    margin-bottom: 16px;
}

.profile-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-desc {
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 4px;
}

.profile-meta {
    color: #64748b;
    font-size: 11px;
}

.profile-actions {
    display: flex;
    gap: 8px;
}

/* ============ Scope Manager ============ */

.scope-loading {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

.scope-controls-top {
    margin-bottom: 16px;
}

.scope-search {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e0e0e0;
    padding: 10px 12px;
    font-size: 13px;
}

.scope-search:focus {
    outline: none;
    border-color: rgba(156, 39, 176, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.scope-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.scope-counter {
    margin-left: auto;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
}

.scope-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.scope-stat-item {
    color: #94a3b8;
    font-size: 11px;
}

.scope-apps-list {
    max-height: 450px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.scope-app-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.scope-app-item:hover {
    background: rgba(156, 39, 176, 0.05);
    border-color: rgba(156, 39, 176, 0.2);
}

.scope-app-item.selected {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.scope-app-item.system-app {
    border-left: 3px solid rgba(255, 152, 0, 0.5);
}

.scope-app-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #9c27b0;
    margin-top: 2px;
    flex-shrink: 0;
}

.scope-app-content {
    flex: 1;
    min-width: 0;
}

.scope-app-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.scope-app-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.scope-app-name {
    flex: 1;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    min-width: 0;
}

.scope-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scope-badge-selected {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.scope-badge-important {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.scope-app-package {
    color: #64748b;
    font-size: 11px;
    font-family: monospace;
    word-break: break-all;
}

.scope-save-section {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

/* ============ LSPosed Module Selector ============ */

.scope-module-selector {
    padding: 20px 0;
}

.scope-selector-title {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.lsposed-modules-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.lsposed-module-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s;
}

.lsposed-module-content {
    flex: 1;
    cursor: pointer;
}

.lsposed-module-toggle {
    flex-shrink: 0;
}

.lsposed-module-item:hover {
    background: rgba(156, 39, 176, 0.1);
    border-color: rgba(156, 39, 176, 0.3);
}

.lsposed-module-name {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    word-break: break-all;
}

.lsposed-module-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.status-badge.status-success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

/* ============ Profile Library ============ */

.profile-library-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-library-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.profile-library-info {
    flex: 1;
    min-width: 0;
}

.profile-library-name {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-library-meta {
    color: #94a3b8;
    font-size: 11px;
    margin-bottom: 4px;
}

.profile-library-desc {
    color: #64748b;
    font-size: 12px;
}

/* Mobile styles */
@media (max-width: 768px) {
    .module-controls {
        padding: 8px;
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .module-controls button {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .module-card {
        padding: 10px;
    }
    
    .module-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .module-name {
        font-size: 13px;
    }
    
    .module-card-actions {
        flex-wrap: wrap;
    }
    
    .module-card-actions .btn-sm {
        font-size: 10px;
        padding: 5px 8px;
    }
    
    .module-modal {
        max-width: 100%;
        margin: 10px;
    }
    
    .module-modal-large {
        max-width: 100%;
    }
    
    .reboot-option {
        padding: 12px;
    }
    
    .reboot-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}
