/* ========================================
   nexUS Observatories - Interactive Components
   Video, Buttons, Forms, Social Links, Live Sky Feed
   ======================================== */

/* Intro Video Styles */
.intro-video-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 3rem auto 2rem;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(10, 25, 47, 0.8);
    border: 2px solid var(--card-border);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
    animation: slideInVideo 1s ease-out 0.5s forwards;
}

.intro-video-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(79, 172, 254, 0.2);
}

.intro-video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    border-radius: 13px;
}

.video-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.intro-video-container:hover .video-controls {
    opacity: 1;
}

.video-control-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: rgba(79, 172, 254, 0.9);
    color: var(--dark-bg);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.video-control-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.video-control-btn:active {
    transform: scale(0.95);
}

/* Video loading state */
.intro-video-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(79, 172, 254, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* Live Sky Feed Styles */
.sky-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--card-border);
}

.sky-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.sky-image:hover {
    opacity: 0.9;
}

.loading-indicator,
.image-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 25, 47, 0.9);
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.loading-indicator i,
.image-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.image-error {
    color: #ff6b6b;
}

.image-error i {
    color: #ff6b6b;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: end;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sky-image-container:hover .image-overlay {
    opacity: 1;
}

.image-timestamp {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: var(--font-display);
}

.enlarge-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(79, 172, 254, 0.9);
    color: var(--dark-bg);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.enlarge-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.feed-info {
    margin-top: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.feed-info p {
    margin: 0.25rem 0;
}

/* Image Modal Styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: rgba(16, 42, 76, 0.95);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid var(--card-border);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-content img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 70vh;
    object-fit: contain;
}

.modal-info {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
}

.modal-info p {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.modal-info small {
    color: var(--text-muted);
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal slide-in animation */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Buttons */
.btn-primary {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 5px;
    color: var(--dark-bg);
    font-family: var(--font-display);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

/* Newsletter */
.newsletter {
    margin: 2rem 0;
    max-width: 500px;
    width: 100%;
}

.newsletter h3 {
    font-family: var(--font-display);
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.newsletter-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid transparent;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: var(--font-primary);
    transition: var(--transition);
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
}

.newsletter-input.error {
    border-color: #ff4444;
}

.error-message {
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: 0.8rem;
    color: #ff4444;
    display: none;
}

.error-message.show {
    display: block;
}

/* Honeypot field (spam prevention) */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
}

.newsletter-button {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 5px;
    color: var(--dark-bg);
    font-family: var(--font-display);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    min-width: 120px;
}

.newsletter-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.newsletter-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
}

.newsletter-button.loading .btn-text {
    display: none;
}

.newsletter-button.loading .btn-loading {
    display: inline-block;
}

.form-message {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    min-height: 20px;
}

.form-message.success {
    color: var(--primary-color);
}

.form-message.error {
    color: #ff4444;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 42, 76, 0.7);
    border: 1px solid var(--card-border);
    color: var(--primary-color);
    font-size: 1.5rem;
    transition: var(--transition);
    text-decoration: none;
}

.social-icon:hover {
    background: rgba(64, 153, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(64, 153, 255, 0.3);
}

/* Responsive Design for Live Sky Feed */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 1rem;
    }
    
    .modal-content img {
        max-height: 60vh;
    }
    
    .image-overlay {
        padding: 0.75rem;
    }
    
    .enlarge-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .image-timestamp {
        font-size: 0.8rem;
    }
}