/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Master Stop Button */
.master-stop-btn {
    background: linear-gradient(135deg, #ff4757, #c44569);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.master-stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

/* Main Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Sections */
section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

section h2, section h3 {
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2,
.section-header h3 {
    margin-bottom: 0; /* Usuwa margines gdy jest w flexie */
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

/* Location Grid */
.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.location-card {
    height: 140px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    overflow: hidden;
}

.location-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.7) 100%);
}

.location-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* Active Location - WSKAŹNIK AKTYWNOŚCI */
.location-card.active {
    border-color: #4ecdc4;
    box-shadow: 0 0 25px rgba(78, 205, 196, 0.6);
    animation: pulse-active 2s infinite;
}

@keyframes pulse-active {
    0% { box-shadow: 0 0 25px rgba(78, 205, 196, 0.6); }
    50% { box-shadow: 0 0 35px rgba(78, 205, 196, 0.8); }
    100% { box-shadow: 0 0 25px rgba(78, 205, 196, 0.6); }
}

.location-name {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    z-index: 1;
    color: white;
}

/* Button Grids */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* Buttons */
button {
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Weather Buttons */
.weather-btn {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
}

.weather-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(116, 185, 255, 0.4);
}

/* Active Weather - WSKAŹNIK AKTYWNOŚCI */
.weather-btn.active {
    background: linear-gradient(135deg, #00b894, #00a085);
    box-shadow: 0 0 20px rgba(0, 184, 148, 0.6);
    animation: pulse-button 1.5s infinite;
}

/* One-shot Buttons */
.oneshot-btn {
    background: linear-gradient(135deg, #fd79a8, #fdcb6e);
    color: white;
}

.oneshot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(253, 121, 168, 0.4);
}

/* Stop Buttons */
.stop-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Button Pulse Animation */
@keyframes pulse-button {
    0% { box-shadow: 0 0 20px rgba(0, 184, 148, 0.6); }
    50% { box-shadow: 0 0 30px rgba(0, 184, 148, 0.8); }
    100% { box-shadow: 0 0 20px rgba(0, 184, 148, 0.6); }
}

/* Volume Controls */
.volume-section {
    margin-top: 15px;
}

.volume-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #ffffff;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.volume-control input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.volume-control span {
    min-width: 50px;
    text-align: right;
    font-weight: bold;
    color: #4ecdc4;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .app-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .app-header h1 {
        font-size: 2rem;
    }
    
    .location-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .button-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .section-header, .panel-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}