body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'PT Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

body {
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.main-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.logo {
    max-width: 80%;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
}

@media (min-width: 600px) {
    .logo {
        max-width: 400px;
    }
}

.search-bar-container {
    position: relative;
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0.6;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1), inset 0 1px 2px rgba(255,255,255,0.7);
    font-size: 1.1rem;
    color: #fff;
    outline: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-input:focus {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 15px rgba(102, 175, 233, 0.5), 0 2px 10px rgba(0,0,0,0.2), inset 0 1px 2px rgba(255,255,255,0.7);
}

.button-container {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.search-button {
    /* background made fully transparent with heavy blur behind */
    background: rgba(255,255,255,0);
    backdrop-filter: blur(89px);
    -webkit-backdrop-filter: blur(89px);
    border: 1px solid rgba(255,255,255,0.08);
    color: #333;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    min-width: 160px;
    border-radius: 999px; /* made round */
}

.search-button:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,1);
    transform: translateY(-1px);
}

.search-button:active {
    background: linear-gradient(180deg, #EFEFEF 0%, #FFFFFF 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    transform: translateY(1px);
}

footer {
    position: absolute;
    bottom: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.page-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.page-content {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 2rem 3rem;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    color: #002b4d;
    text-shadow: 0 1px 1px rgba(255,255,255,0.7);
}

.page-content h1, .page-content h2 {
    color: #00457c;
    text-shadow: 0 2px 3px rgba(255,255,255,0.5);
    margin-top: 0;
}

/* 404 page: single-line tweak — already uses page-content visuals, no extra styles needed */

.page-content p, .page-content li {
    line-height: 1.6;
}

.back-button {
    background: rgba(255,255,255,0);
    backdrop-filter: blur(89px);
    -webkit-backdrop-filter: blur(89px);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 8px 16px;
    border-radius: 999px; /* made round */
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2), inset 0 1px 1px rgba(255,255,255,1);
    transition: all 0.2s ease;
}

.back-button:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,1);
    transform: translateY(-1px);
}

.areotube-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.5);
    padding-bottom: 1rem;
}

.areotube-logo {
    height: 50px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.areotube-header .back-button {
    margin-bottom: 0;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-card h3 {
    font-size: 1rem;
    margin: 0;
    color: #003865;
}

/* App pages (Docs, Slides) */
.areoogle-app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 1rem;
}

.areoogle-app-logo {
    height: 45px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.create-new-button {
    background: rgba(255,255,255,0);
    backdrop-filter: blur(89px);
    -webkit-backdrop-filter: blur(89px);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    margin-bottom: 2rem;
    border-radius: 999px; /* made round */
}

.create-new-button:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,1);
    transform: translateY(-1px);
}

.create-new-button img {
    width: 24px;
    height: 24px;
}

.document-list {
    list-style: none;
    padding: 0;
}

.document-list li {
    background: rgba(255, 255, 255, 0.3);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.document-list li:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(5px);
}

.doc-icon {
    font-size: 1.2rem;
}

/* Wallpaper page */
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.wallpaper-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    aspect-ratio: 16 / 9;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wallpaper-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.wallpaper-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Areotify Page */
.areotify-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.now-playing {
    display: flex;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.3);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.album-art {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.song-info h3 {
    margin: 0 0 5px 0;
    color: #003865;
}

.song-info p {
    margin: 0 0 15px 0;
    font-size: 1rem;
    opacity: 0.8;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
    border-radius: 3px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.controls img {
    width: 24px;
    height: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.controls img:hover {
    opacity: 1;
    transform: scale(1.1);
}

.controls img:nth-child(2) { /* Play button */
    width: 36px;
    height: 36px;
}

/* Add look-at effect styles */
.is-looked {
    will-change: transform;
    transform-origin: center center;
    transition: transform 120ms ease-out;
    /* give a subtle 3D lift when active */
    box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.playlist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.playlist li {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.playlist li:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.playlist-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
}

.playlist h4 {
    margin: 0 0 4px 0;
    color: #00457c;
}

.playlist p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Areo AI Page */
.chat-body {
    display: flex;
    flex-direction: column;
    height: 65vh;
}

#chat-history {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.5;
}

.chat-message p {
    margin: 0;
}

.ai-message {
    background: rgba(255, 255, 255, 0.5);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.user-message {
    background: linear-gradient(135deg, #72EDF2 0%, #5151E5 100%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

#chat-form {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

#chat-input {
    flex-grow: 1;
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.7);
    font-size: 1rem;
    color: #002b4d;
    outline: none;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#chat-input::placeholder {
    color: rgba(0, 43, 77, 0.6);
}

#chat-submit {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px; /* made round for touch targets */
}

#chat-submit img {
    width: 28px;
    height: 28px;
    transition: transform 0.2s ease;
}

#chat-submit:hover img {
    transform: scale(1.1) rotate(5deg);
}

.thinking {
    font-style: italic;
    opacity: 0.7;
    animation: pulse 1.5s infinite;
}

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

.apps-button {
    background: rgba(255,255,255,0);
    backdrop-filter: blur(89px);
    -webkit-backdrop-filter: blur(89px);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 6px;
    border-radius: 999px; /* made round */
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.apps-button img { width: 22px; height:22px; display:block; }

/* Settings panel tweaks reuse apps-panel styles but ensure centered content */
#settings-panel .apps-panel-inner {
    /* make the panel slightly translucent so the backdrop blur is visible */
    background: rgba(255, 255, 255, 0.82);
    /* frosted glass blur */
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
    border-radius: 12px;
    padding: 18px;
    color: #002b4d;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.6);
}

/* apps panel */
.apps-panel {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    z-index: 60;
    align-items: stretch;
    justify-content: flex-start;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.apps-panel-inner {
    background: rgba(255,255,255,0);
    border-radius: 16px;
    padding: 18px;
    width: 100%;
    max-width: none;
    height: 100%;
    border-radius: 0;
    padding: 18px;
    box-sizing: border-box;
    overflow: auto;
    color: #002b4d;
}
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px,1fr));
    gap: 12px;
    margin-top: 12px;
}
.app-tile {
    background: rgba(255,255,255,0);
    backdrop-filter: blur(89px);
    -webkit-backdrop-filter: blur(89px);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 10px;
    cursor: pointer;
    font-weight:600;
    border-radius: 999px; /* made round */
}
.app-tile img { width:36px; height:36px; object-fit:contain; border-radius:6px; }

/* Video modal */
.video-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 120;
    padding: 20px;
    /* center modal and allow inner to scroll */
}
.video-modal-inner {
    width: 100%;
    max-width: 1100px;
    max-height: 90vh; /* constrain so page doesn't overflow */
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    background: #000;
    overflow: auto; /* make inner content scrollable when needed */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* Channel button inside video modal */
#video-modal-channel {
    position: absolute;
    top: 12px;
    right: 110px;
    z-index: 130;
    display: none;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
}
@media (max-width: 600px) {
    #video-modal-channel { right: 80px; top: 8px; padding: 8px; }
}
.video-modal-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius:8px; }
.video-modal-embed iframe { position:absolute; inset:0; width:100%; height:100%; border:0; border-radius:8px; }

/* Make external embed page fill the window content area */
#external-embed .embed-content {
    width: 100%;
    max-width: none;
    height: 100%;
    padding: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    justify-content: flex-start;
}
#external-embed iframe#external-iframe {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

/* Compose modal */
#compose-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    z-index: 220;
    padding: 20px;
}
#compose-modal .page-content {
    max-width: 720px;
    width: 100%;
    background: rgba(255,255,255,0.95);
    color: #002b4d;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
#compose-modal input, #compose-modal textarea {
    font-family: inherit;
    font-size: 1rem;
    color: #002b4d;
}

/* Fix Embeds Modal (reuses page-container / page-content visuals) */
#fix-embeds-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    z-index: 250;
    padding: 20px;
}
#fix-embeds-modal .page-content {
    max-width: 420px;
    width: 100%;
    background: rgba(255,255,255,0.95);
    color: #002b4d;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
/* Ensure create-new-button links inside modal look like buttons and open in new tab */
#fix-embeds-modal .create-new-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 600px) {
    .page-content {
        padding: 1.5rem;
    }
    .areotube-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .now-playing {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .embed-content {
        padding: 1rem;
        background: rgba(255,255,255,0.06);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        justify-content: flex-start;
    }
    .embed-content iframe { height: calc(100vh - 140px); }
}

.result-card {
    display:flex;
    gap:12px;
    align-items:flex-start;
    background: rgba(255,255,255,0.3);
    padding:12px;
    border-radius:10px;
}
.result-thumb {
    width:96px;
    height:64px;
    object-fit:cover;
    border-radius:6px;
    flex-shrink:0;
    background:rgba(0,0,0,0.08);
}
.result-meta { flex:1; }
.result-meta h3 { margin:0 0 6px 0; color:#003865; font-size:1rem; }
.result-meta a { color: #00457c; text-decoration: none; font-weight:600; }
.result-meta p { margin:0;color:#002b4d;opacity:0.9;line-height:1.3;font-size:0.95rem; }

#settings-button {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 200;
    padding: 8px;
    border-radius: 12px;
}
#settings-button img.settings-icon { width: 28px; height: 28px; display:block; }

/* Respect user's disable animations preference by removing transitions/hover transforms */
.no-animations * {
    transition: none !important;
    animation: none !important;
}
.no-animations .is-looked { box-shadow: none !important; transform: none !important; }

/* Make all text inside the video modal/player white for better contrast */
.video-modal, 
.video-modal * {
    color: #ffffff !important;
}

/* Ensure card titles and meta inside the modal are white and keep backgrounds legible */
.video-modal .video-card h3 {
    color: #ffffff !important;
}

#channel-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}