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

/* Intro Video Styles */
.intro-video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 3rem auto 2rem;
    border-radius: 15px;
    overflow: visible;
    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;
    min-height: 260px;
}

.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;
    min-height: 260px;
    overflow: hidden;
}

.video-controls {
    position: absolute;
    bottom: 1px !important;
    right: 100px !important;
    display: flex;
    gap: 4px;
    opacity: 0.1;
    transition: opacity 0.3s ease;
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 25px;
    padding: 6px;
    border: 1px solid rgba(79, 172, 254, 0.5);
}

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

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

.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: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--card-border);
    min-height: 300px;
}

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

.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;
}

/* 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;
}

.newsletter-input {
    flex: 1;
    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 BUTTON STYLES - Fix for Issue #95
   ============================================================================= */

.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);
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

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

/* Button text and loading states */
.newsletter-button .btn-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.newsletter-button .btn-loading {
    display: none; /* Hidden by default */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Loading state - when button has .loading class */
.newsletter-button.loading .btn-text {
    opacity: 0; /* Hide the text */
}

.newsletter-button.loading .btn-loading {
    display: inline-block; /* Show the spinner */
    opacity: 1;
}

.newsletter-button.loading {
    cursor: not-allowed;
    opacity: 0.8;
}

/* Ensure loading spinner is properly styled */
.newsletter-button .btn-loading i {
    color: var(--dark-bg);
    font-size: 1rem;
}

/* 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);
}

/* =============================================================================
   IMAGE MODAL STYLES - Fix for Issue #86 - FORCED REFRESH DEPLOYMENT 
   ============================================================================= */

/* Modal container - MUST BE HIDDEN BY DEFAULT */
.image-modal {
    display: none !important; /* Force hidden by default with !important */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show modal when explicitly activated */
.image-modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Modal backdrop */
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

/* Modal content container */
.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--card-bg, rgba(16, 42, 76, 0.95));
    border: 2px solid var(--card-border, rgba(79, 172, 254, 0.3));
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 10000;
    animation: modalSlideIn 0.3s ease-out;
}

/* Modal image */
.modal-content img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
}

/* Modal close button */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--text-primary, #e0f7ff);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color, #4facfe);
    transform: scale(1.1);
}

.modal-close:focus {
    outline: 3px solid var(--primary-color, #4facfe);
    outline-offset: 2px;
}

/* Modal info section */
.modal-info {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted, #a0c4ff);
}

.modal-info p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.modal-info small {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Modal animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Image overlay for timestamp and enlarge button */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0, 0, 0, 0.5) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

/* Image timestamp */
.image-timestamp {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-primary, #e0f7ff);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-family: 'Orbitron', monospace;
    pointer-events: auto;
}

/* Enlarge button */
.enlarge-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--text-primary, #e0f7ff);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.enlarge-btn:hover {
    background: var(--primary-color, #4facfe);
    color: var(--dark-bg, #0a192f);
    transform: scale(1.1);
}

.enlarge-btn:focus {
    outline: 2px solid var(--primary-color, #4facfe);
    outline-offset: 2px;
}

/* Responsive design */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        padding: 15px;
    }
    
    .modal-content img {
        max-height: 60vh;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        top: 10px;
        right: 10px;
        font-size: 1rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .modal-content {
        animation: none;
    }
    
    .image-modal,
    .modal-close,
    .enlarge-btn {
        transition: none;
    }
}

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