/* Sky Webcam Gallery Styles */

.sky-webcam-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.sky-webcam-controls {
    margin-bottom: 30px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.sky-webcam-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.sky-webcam-date-select {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sky-webcam-date-select label {
    font-weight: bold;
    margin: 0;
    white-space: nowrap;
}

.sky-webcam-date-select select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
}

.sky-webcam-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.sky-webcam-live-badge {
    font-weight: 600;
    color: #2e7d32;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.sky-webcam-live-dot {
    display: inline-block;
    color: #4caf50;
    animation: pulse-green 1s infinite;
    line-height: 1;
    font-size: 12px;
}

@keyframes pulse-green {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

.sky-webcam-archive-badge {
    font-weight: 600;
    color: #1976d2;
    font-size: 13px;
    white-space: nowrap;
}

.sky-webcam-refresh-info {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.sky-webcam-gallery {
    margin-bottom: 30px;
}

.sky-webcam-no-images {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.sky-webcam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sky-webcam-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sky-webcam-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sky-webcam-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.sky-webcam-item a {
    text-decoration: none;
    color: inherit;
}

.sky-webcam-info {
    padding: 12px;
    background: #fafafa;
}

.sky-webcam-filename {
    margin: 0 0 5px 0;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    word-break: break-word;
}

.sky-webcam-date {
    margin: 0;
    font-size: 12px;
    color: #999;
}

.sky-webcam-time {
    font-weight: 600;
    color: #0073aa;
    margin-left: 8px;
}

.sky-webcam-stats {
    padding: 15px;
    background: #f0f0f0;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
}

.sky-webcam-stats p {
    margin: 5px 0;
}

.sky-webcam-last-update {
    font-size: 13px;
    color: #666;
}

#sky-webcam-update-time {
    font-weight: 600;
    color: #d32f2f;
}

.sky-webcam-next-refresh {
    font-size: 13px;
    color: #666;
}

#sky-webcam-countdown {
    font-weight: 600;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 30px;
    display: inline-block;
    text-align: center;
}

/* Lightbox Modal Styles */

.sky-webcam-lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 20px;
}

.sky-webcam-lightbox-content {
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
}

.sky-webcam-lightbox-content img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.sky-webcam-lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    line-height: 1;
    transition: color 0.3s;
    z-index: 10000;
}

.sky-webcam-lightbox-close:hover,
.sky-webcam-lightbox-close:focus {
    color: #bbb;
    outline: none;
}

/* Timelapse Styles */

.sky-webcam-timelapse-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.sky-webcam-creator {
    background: white;
    padding: 30px;
    border-radius: 4px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sky-webcam-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

.form-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.sky-webcam-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    margin-bottom: 15px;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 33%;
    background: #ffc107;
    animation: progress 2s infinite;
}

@keyframes progress {
    0% { width: 0; }
    50% { width: 100%; }
    100% { width: 0; }
}

.sky-webcam-result {
    margin-top: 20px;
}

.timelapse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.timelapse-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timelapse-item h4 {
    padding: 15px;
    margin: 0;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
    word-break: break-word;
}

.timelapse-item video {
    display: block;
    width: 100%;
}

.timelapse-info {
    padding: 15px;
    border-top: 1px solid #ddd;
}

.timelapse-info p {
    margin: 8px 0;
    font-size: 13px;
}

.timelapse-info .button {
    display: inline-block;
    margin-top: 10px;
}

/* Responsive */

@media (max-width: 768px) {
    .sky-webcam-form {
        grid-template-columns: 1fr;
    }

    .sky-webcam-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .timelapse-grid {
        grid-template-columns: 1fr;
    }

    .sky-webcam-controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .sky-webcam-date-select {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .sky-webcam-date-select select {
        width: 100%;
        min-width: auto;
    }

    .sky-webcam-status {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .sky-webcam-live-badge,
    .sky-webcam-archive-badge {
        white-space: normal;
    }
}
