:root {
    --glass-bg: rgba(0, 0, 0, 0.2)
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: rgba(0, 0, 0, 0.1);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
}

#content {
    position: relative;
    width: 100vw;
    height: 100vh;
}

model-viewer {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
}

.glass-morphism {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 var(--glass-shadow);
}

.logo-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.action-group {
    position: fixed;
    right: min(20px, 3%);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1vh, 15px);
    z-index: 1000;
    padding: clamp(8px, 1.5vh, 15px);
    border-radius: clamp(15px, 2vh, 25px);
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.action-button {
    width: clamp(45px, 7vw, 55px);
    height: clamp(45px, 7vw, 55px);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.3rem, 2.2vw, 1.6rem);
    transition: all 0.3s ease;
    background: transparent;
    color: white;
}

.action-button i {
    color: white;
}

.action-button:hover {
    transform: scale(1.1);
}

.logo-button {
    width: clamp(45px, 7vw, 55px);
    height: clamp(45px, 7vw, 55px);
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: clamp(6px, 1vh, 15px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.logo-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* Hide initially */
}

.logo-button img.loaded {
    display: block;
}

.logo-fallback.hidden {
    display: none;
}

.logo-fallback {
    font-size: 24px;
    color: var(--primary-color, #6C5CE7);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    padding: 24px;
    border-radius: 20px;
    width: 90%;
    max-width: 340px;
    background: rgb(23, 32, 42);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.modal.show {
    display: block;
    opacity: 1;
    visibility: visible;
}

.modal-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: white;
    font-weight: 600;
}

.close-button {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}

.close-button:hover {
    opacity: 1;
}

.modal-content {
    max-height: none;
    overflow-y: visible;
    margin: clamp(10px, 2vh, 15px) 0;
    padding: 0 clamp(10px, 2vw, 15px);
}

.modal-content p {
    margin: 0 0 15px 0;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 0 5px;
}

.modal-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.custom-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2196F3;
    color: white !important;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.custom-link:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.custom-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: currentColor;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.custom-link:hover::after {
    transform: scaleX(1);
}

.modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.share-button {
    width: 100%;
    height: 44px;
    border-radius: 8px;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-button.facebook {
    background: #1877f2;
}

.share-button.twitter {
    background: #1da1f2;
}

.share-button.linkedin {
    background: #0a66c2;
}

.share-button.copy {
    background: rgba(255, 255, 255, 0.1);
}

.share-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.time-remaining {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 1000;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.time-remaining.urgent {
    color: #ff4444 !important;
}

.time-remaining.urgent i {
    color: #ff4444 !important;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background-color: #4CAF50;
    color: white;
}

.notification.error {
    background-color: #f44336;
    color: white;
}

/* Theme switching based on background intensity */
.light-theme {
    color: #000;
}

.dark-theme {
    color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .action-group {
        right: 15px;
        padding: 8px;
        gap: 8px;
    }

    .action-button {
        width: 35px;
        height: 35px;
        font-size: 0.9em;
    }

    .logo-button {
        width: 35px;
        height: 35px;
    }

    .modal {
        width: 80%;
        padding: 22px 28px;
    }

    .modal-content h2 {
        font-size: 1.5em;
    }

    .share-button {
        height: 40px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .action-group {
        right: 10px;
        padding: 6px;
        gap: 6px;
    }

    .action-button {
        width: 30px;
        height: 30px;
        font-size: 0.8em;
    }

    .logo-button {
        width: 30px;
        height: 30px;
    }

    .modal {
        width: 85%;
        padding: 20px 25px;
    }

    .modal-content h2 {
        font-size: 1.3em;
    }

    .modal-content p {
        font-size: 0.9em;
    }

    .share-button {
        height: 35px;
        font-size: 0.9em;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .action-button {
        width: 45px;
        height: 45px;
        font-size: 1.1em;
    }

    .logo-button {
        width: 45px;
        height: 45px;
    }

    .time-remaining {
        top: 30px;
        padding: 8px 16px;
        font-size: clamp(0.6rem, 1.5vw, 1.2rem);
    }

    .ar-view-button {
        bottom: 50px !important;
        padding: 15px 35px;
        font-size: clamp(0.6rem, 1.5vw, 1.2rem);
    }
}

@media (max-width: 480px) {
    .action-button {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }

    .logo-button {
        width: 40px;
        height: 40px;
    }

    .time-remaining {
        top: 20px;
        padding: 8px 16px;
        font-size: clamp(0.6rem, 1.5vw, 1.2rem);
        width: auto;
        max-width: 80%;
    }

    .ar-view-button {
        bottom: 40px !important;
        padding: 12px 30px;
        font-size: clamp(0.6rem, 1.5vw, 1.2rem);
    }
}

/* Safe area adjustments for iOS */
@supports (padding: max(0px)) {
    .time-remaining {
        top: max(40px, env(safe-area-inset-top) + 20px);
    }

    .ar-view-button {
        bottom: max(60px, env(safe-area-inset-bottom) + 30px) !important;
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .modal {
        width: 70%;
        padding: 22px;
    }
}

@media (max-width: 768px) {
    .modal {
        width: 85%;
        padding: 20px;
        max-height: 75vh;
    }

    .modal-content {
        max-height: calc(75vh - 160px);
    }

    .modal-header h2 {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .modal {
        width: 95%;
        padding: 20px 22px;
        max-height: 80vh;
    }

    .modal-content {
        max-height: calc(80vh - 140px);
        margin: 15px 0;
        padding: 0 3px 0 3px;
    }

    .modal-header h2 {
        font-size: 1.3em;
    }

    .modal-content p {
        font-size: 0.95em;
        line-height: 1.6;
    }

    .custom-link {
        font-size: 0.95em;
    }
}

/* For very small screens */
@media (max-width: 360px) {
    .modal {
        width: 90%;
        padding: 18px 22px;
    }

    .modal-content {
        margin: 12px 0;
    }
}

/* For landscape orientation */
@media (max-height: 600px) {
    .modal {
        max-height: 85vh;
    }

    .modal-content {
        max-height: calc(85vh - 120px);
    }
}

/* Responsive Design */
@media screen and (min-width: 768px) {
    .modal {
        width: 80%;
        max-width: 500px;
    }
}

@media screen and (max-width: 480px) {
    .modal {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
    }

    .modal-content {
        margin: 15px 0;
        max-height: calc(85vh - 160px);
    }

    .custom-link {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
}

/* Landscape mode */
@media screen and (max-height: 600px) {
    .modal {
        max-height: 90vh;
    }

    .modal-content {
        max-height: calc(90vh - 140px);
    }
}

/* Add these styles at the end of the file */
.subscribe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
}

.subscribe-content {
    text-align: center;
    padding: 40px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
}

.expired-icon {
    font-size: 48px;
    color: #ff4444;
    margin-bottom: 20px;
}

.subscribe-content h2 {
    color: white;
    margin-bottom: 15px;
    font-size: 24px;
}

.subscribe-content p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 25px;
    font-size: 16px;
}

.subscribe-button {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.subscribe-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.subscribe-button i {
    font-size: 18px;
}

/* Media Queries */
@media (max-width: 480px) {
    .subscribe-content {
        padding: 30px;
    }

    .expired-icon {
        font-size: 36px;
    }

    .subscribe-content h2 {
        font-size: 20px;
    }

    .subscribe-content p {
        font-size: 14px;
    }

    .subscribe-button {
        padding: 12px 25px;
        font-size: 14px;
    }
}

.model-loading-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    z-index: 1000;
    text-align: center;
    color: white;
    transition: opacity 0.3s ease;
}

.loading-text {
    margin-bottom: 10px;
    font-size: 16px;
    color: white;
}

.loading-bar-container {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: var(--primary-color, #6C5CE7);
    transition: width 0.3s ease;
}

/* Media queries for fine-tuning */
@media (max-width: 768px) {
    .action-button {
        width: clamp(25px, 5vw, 45px);
        height: clamp(25px, 5vw, 45px);
        font-size: clamp(0.7rem, 1.8vw, 1.1rem);
    }
}

@media (max-width: 480px) {
    .action-button {
        width: clamp(20px, 6vw, 40px);
        height: clamp(20px, 6vw, 40px);
        font-size: clamp(0.6rem, 2vw, 1rem);
    }
}

/* Remove the conflicting .ar-button styles */
.ar-button {
    display: none;
}

/* Use the working ar-view-button style */
.ar-view-button {
    /* Glass morphism */
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    
    /* Text styling */
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    text-transform: uppercase;
    letter-spacing: 1px;
    
    /* Button layout */
    border-radius: 30px;
    padding: clamp(10px, 2vh, 20px) clamp(20px, 4vw, 40px);
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 1.5vw, 12px);
    
    /* Positioning */
    position: fixed !important;
    bottom: 60px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 1000 !important;
    margin-bottom: env(safe-area-inset-bottom, 15px) !important;
    
    /* Size */
    width: fit-content;
    min-width: clamp(160px, 30vw, 200px);
    max-width: 90%;
    
    /* Effects */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.ar-view-button i {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    margin-right: 2px;
}

/* Hover effect */
.ar-view-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-50%) translateY(-2px) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Active state */
.ar-view-button:active {
    transform: translateX(-50%) scale(0.98) !important;
    background: rgba(255, 255, 255, 0.15);
}

/* Media queries for mobile devices */
@media (max-width: 768px) {
    .action-button {
        width: clamp(45px, 7vw, 55px);
        height: clamp(45px, 7vw, 55px);
        font-size: clamp(1.3rem, 2.2vw, 1.6rem);
    }

    .logo-button {
        width: clamp(45px, 7vw, 55px);
        height: clamp(45px, 7vw, 55px);
    }

    .ar-view-button {
        bottom: 80px !important;
        padding: clamp(12px, 2vh, 18px) clamp(25px, 4vw, 35px);
        font-size: clamp(0.9rem, 1.8vw, 1.2rem);
    }
}

@media (max-width: 480px) {
    .action-button {
        width: clamp(42px, 8vw, 50px);
        height: clamp(42px, 8vw, 50px);
        font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    }

    .logo-button {
        width: clamp(42px, 8vw, 50px);
        height: clamp(42px, 8vw, 50px);
    }

    .ar-view-button {
        bottom: 70px !important;
        padding: 12px 25px;
    }
}

@media (max-height: 600px) {
    .ar-view-button {
        bottom: 60px !important;
        padding: 10px 20px;
    }
}

/* Safe area adjustments for iOS */
@supports (padding: max(0px)) {
    .ar-view-button {
        bottom: max(80px, env(safe-area-inset-bottom) + 65px) !important;
    }
}

/* Media queries for fine-tuning */
@media (max-width: 768px) {
    .logo-button {
        width: clamp(25px, 5vw, 45px);
        height: clamp(25px, 5vw, 45px);
        margin-bottom: clamp(5px, 0.8vh, 12px);
    }
}

@media (max-width: 480px) {
    .logo-button {
        width: clamp(20px, 6vw, 40px);
        height: clamp(20px, 6vw, 40px);
        margin-bottom: clamp(4px, 0.6vh, 10px);
    }
}

/* Hide default model-viewer AR button */
model-viewer::part(default-ar-button) {
    display: none !important;
}

/* iOS specific adjustments */
@supports (-webkit-touch-callout: none) {
    .ar-view-button {
        bottom: 100px !important;
    }
}

/* Safe area adjustments for iOS */
@supports (padding: max(0px)) {
    .ar-view-button {
        bottom: max(100px, env(safe-area-inset-bottom) + 85px) !important;
    }
}

/* Remove any conflicting media queries */
@media (max-width: 768px) {
    .logo-button {
        width: clamp(45px, 7vw, 55px) !important;
        height: clamp(45px, 7vw, 55px) !important;
    }
}

.qr-code-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#qrcode {
    background: white;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#qrcode img {
    width: 180px !important;
    height: 180px !important;
    display: block;
}

.qr-code-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
    text-align: center;
}

/* Update modal content styles for QR code */
.modal-content {
    max-height: 70vh;
    overflow-y: auto;
    margin: 15px 0;
    padding: 0 10px;
}

/* Responsive adjustments for QR code */
@media (max-width: 480px) {
    .qr-code-container {
        padding: 15px;
        margin-bottom: 20px;
    }

    #qrcode {
        padding: 10px;
        margin-bottom: 10px;
    }

    #qrcode img {
        width: 150px !important;
        height: 150px !important;
    }

    .qr-code-text {
        font-size: 0.8rem;
    }
}

/* Media queries for different screen sizes */
@media (max-width: 768px) {
    .modal {
        padding: 20px;
    }

    .qr-code-container {
        padding: 15px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 15px;
        width: 95%;
    }

    .qr-code-container {
        padding: 12px;
        margin-bottom: 15px;
    }

    .share-buttons {
        gap: 8px;
    }

    .share-button {
        height: 40px;
        font-size: 0.9em;
    }
}

/* Safe area insets for modern mobile devices */
@supports (padding: max(0px)) {
    .modal {
        padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    }
}

.desktop-notice {
    display: none;
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 16px 24px;
    width: fit-content;
    max-width: 90%;
    background: rgba(0, 0, 0, 0.2);
}

.desktop-notice i {
    color: #ffffff;
    margin-right: 8px;
    font-size: 16px;
}

.desktop-notice p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.desktop-notice .progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    width: 100%;
    overflow: hidden;
}

.desktop-notice .progress-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    animation: progress 10s linear forwards;
    transform-origin: left;
}

@keyframes progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    to {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
}

.desktop-notice.show {
    display: flex;
    animation: slideUp 0.3s ease forwards;
}

.desktop-notice.hide {
    animation: slideDown 0.3s ease forwards;
}

/* Safe area insets for modern mobile devices */
@supports (padding: max(0px)) {
    .desktop-notice {
        bottom: max(100px, env(safe-area-inset-bottom) + 85px);
    }
}
