/* style.css - LG Remote Control Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.remote-container {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 420px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.app-title {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.app-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    letter-spacing: 1px;
}

.connection-panel {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.connection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4444;
    transition: all 0.3s ease;
}

.status-indicator.connected {
    background: #44ff44;
    box-shadow: 0 0 15px rgba(68, 255, 68, 0.6);
    animation: pulse 2s infinite;
}

.status-indicator.connecting {
    background: #ffaa00;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ip-input-group {
    display: flex;
    gap: 8px;
}

input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

input[type="text"]:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.connect-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.connect-btn:active {
    transform: translateY(0);
}

.connect-btn.connected {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.connect-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tv-list {
    margin-top: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.tv-item {
    padding: 10px;
    margin: 4px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
}

.tv-item:hover {
    background: rgba(102, 126, 234, 0.3);
}

.quick-status {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
}

.status-item {
    text-align: center;
}

.status-label {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.status-value {
    color: white;
    font-size: 13px;
    font-weight: 600;
}

.section-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 16px 0 10px 0;
    text-align: center;
}

.dpad {
    display: grid;
    grid-template-areas:
        ". up ."
        "left center right"
        ". down .";
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 8px;
    max-width: 220px;
    margin: 0 auto;
}

.dpad-btn {
    aspect-ratio: 1;
    min-height: 60px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.dpad-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.dpad-btn:active::after {
    width: 200px;
    height: 200px;
}

.dpad-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.dpad-btn:active {
    background: rgba(102, 126, 234, 0.4);
    transform: scale(0.95);
}

.dpad-up { grid-area: up; }
.dpad-down { grid-area: down; }
.dpad-left { grid-area: left; }
.dpad-right { grid-area: right; }
.dpad-center { 
    grid-area: center;
    background: rgba(102, 126, 234, 0.3);
    font-weight: bold;
}

.vol-ch-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 12px 0;
}

.vol-ch-group {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
}

.vol-ch-label {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.vol-ch-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.vol-ch-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.vol-ch-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.vol-ch-btn:active {
    background: rgba(102, 126, 234, 0.4);
}

.mute-btn {
    font-size: 14px;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0;
}

.control-btn {
    padding: 12px 6px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    border: none;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.control-btn:active {
    background: rgba(102, 126, 234, 0.4);
    transform: scale(0.95);
}

.app-launcher {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 12px 0;
}

.app-btn {
    padding: 14px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    border: none;
}

.app-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.app-btn:active {
    background: rgba(102, 126, 234, 0.3);
}

.info-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 10px;
    margin-top: 16px;
    line-height: 1.6;
}

.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 13px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .remote-container {
        padding: 16px;
        border-radius: 20px;
    }
    
    .dpad-btn {
        min-height: 50px;
    }
    
    .control-btn {
        padding: 10px 4px;
        font-size: 11px;
    }
}

@media (min-width: 768px) {
    .app-launcher {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Scrollbar styling */
.tv-list::-webkit-scrollbar {
    width: 4px;
}

.tv-list::-webkit-scrollbar-track {
    background: transparent;
}

.tv-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}