/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: -1;
}

/* Hide video controls completely */
video::-webkit-media-controls {
    display: none !important;
}

video::-webkit-media-controls-panel {
    display: none !important;
}

video::-webkit-media-controls-play-button {
    display: none !important;
}

video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

/* Ensure no scrollbars on any device */
body::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Interactive Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 1s ease-in-out;
    overflow-y: auto;
    overflow-x: hidden;
}

.content-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hide container background when showing dreamcatcher */
.content-container:has(#dreamcatcher-prompt:not([style*="display: none"])) {
    background: transparent;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 20px;
}

.title {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: normal;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1em;
    color: #5d6d7e;
    margin-bottom: 30px;
    line-height: 1.6;
    font-style: italic;
}

/* Dreamcatcher Button */
.dreamcatcher-container {
    text-align: center;
    margin-bottom: 20px;
}

.dreamcatcher-button {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    padding: 20px 30px;
    color: white;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Profile Form Styles */
.profile-form {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    border: 2px solid rgba(106, 90, 205, 0.3);
    backdrop-filter: blur(10px);
    display: none;
}

.profile-form:not(.hidden) {
    display: block;
}

.profile-form h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.profile-form p {
    color: #5d6d7e;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.form-row {
    margin-bottom: 15px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(106, 90, 205, 0.3);
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #6a5acd;
    box-shadow: 0 0 10px rgba(106, 90, 205, 0.3);
}

.profile-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: bold;
}

.profile-status.connected {
    background: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.profile-status.new {
    background: rgba(33, 150, 243, 0.2);
    color: #1565c0;
    border: 1px solid rgba(33, 150, 243, 0.5);
}

.profile-status.error {
    background: rgba(244, 67, 54, 0.2);
    color: #c62828;
    border: 1px solid rgba(244, 67, 54, 0.5);
}

.connection-info {
    margin-top: 15px;
    padding: 15px;
    background: rgba(106, 90, 205, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(106, 90, 205, 0.3);
}

.glow-indicator {
    text-align: center;
}

.glow-level {
    display: block;
    color: #2c3e50;
    font-weight: bold;
    margin-bottom: 8px;
}

.glow-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(106, 90, 205, 0.3);
}

.glow-fill {
    height: 100%;
    background: linear-gradient(90deg, #6a5acd, #9370db);
    transition: width 0.5s ease;
    width: 0%;
}

.profile-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.save-profile-button {
    flex: 1;
    background: linear-gradient(135deg, #6a5acd, #9370db);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-profile-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(106, 90, 205, 0.4);
}

.cancel-button {
    flex: 1;
    background: rgba(108, 117, 125, 0.8);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-button:hover {
    background: rgba(108, 117, 125, 1);
}

.dreamcatcher-button:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
}

.dreamcatcher-symbol {
    font-size: 24px;
    animation: dreamcatcherFloat 3s ease-in-out infinite;
}

.dreamcatcher-text {
    font-style: italic;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes dreamcatcherFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(2deg);
    }
}

/* Input Section */
.input-section {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.input-section.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    position: absolute;
    width: 100%;
}

.back-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 8px 15px;
    color: white;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    display: inline-block;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-3px);
}

.input-container {
    position: relative;
    margin-bottom: 25px;
}

#message-input {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 2px solid #bdc3c7;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Georgia', 'Times New Roman', serif;
    resize: none;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

#message-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.char-counter {
    position: absolute;
    bottom: -20px;
    right: 5px;
    font-size: 12px;
    color: #7f8c8d;
}

.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.release-button, .save-button {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-family: 'Georgia', 'Times New Roman', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.release-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.release-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.save-button {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.view-button {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
    color: white;
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
}

.view-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(142, 68, 173, 0.4);
}

/* Floating Messages */
#floating-messages {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.floating-container {
    position: absolute;
    pointer-events: none;
    z-index: 11;
    will-change: transform, opacity;
}

.floating-symbol {
    font-size: 2rem;
    margin-bottom: 8px;
    animation: symbolGlow 6s ease-in-out forwards;
    text-align: center;
    position: relative;
    z-index: 15;
}

.floating-message-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 255, 255, 0.4);
    animation: floatDownEnhanced 6s ease-in forwards;
    max-width: 200px;
    word-wrap: break-word;
    position: relative;
    z-index: 15;
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
    backdrop-filter: blur(2px);
}

.ripple-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: rippleExpand 3s ease-out forwards;
}

@keyframes floatDownEnhanced {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
    }
    20% {
        opacity: 1;
        transform: translateY(10vh) translateX(5px) rotate(1deg) scale(1.1);
    }
    60% {
        opacity: 0.7;
        transform: translateY(60vh) translateX(30px) rotate(3deg) scale(0.9);
    }
    90% {
        opacity: 0.3;
        transform: translateY(85vh) translateX(50px) rotate(5deg) scale(0.7);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) translateX(70px) rotate(7deg) scale(0.5);
    }
}

@keyframes symbolGlow {
    0% {
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
        transform: scale(1);
    }
    25% {
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1));
        transform: scale(1.2);
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.9));
        transform: scale(1.1);
    }
    75% {
        filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.6));
        transform: scale(0.9);
    }
    100% {
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
        transform: scale(0.7);
    }
}

@keyframes rippleExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(6);
        opacity: 0;
    }
}

@keyframes whisperExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0.4;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* Success Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 15px;
}

.modal-content p {
    font-size: 1.1em;
    color: #5d6d7e;
    margin-bottom: 25px;
    font-style: italic;
}

.modal-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* Enhanced Form Styles */
.enhanced-form {
    margin-top: 20px;
    transition: opacity 0.3s ease;
}

.enhanced-form.hidden {
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

.form-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.toggle-text {
    color: #5d6d7e;
    font-style: italic;
    font-size: 14px;
}

.toggle-button {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
}

.toggle-button.active {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.enhanced-fields {
    transition: all 0.3s ease;
}

.enhanced-fields.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

.form-row {
    margin-bottom: 15px;
    position: relative;
}

.form-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Georgia', 'Times New Roman', serif;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #8e44ad;
    box-shadow: 0 0 8px rgba(142, 68, 173, 0.3);
}

.profile-status {
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
}

.profile-status.connected {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.profile-status.new {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.profile-status.error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.connection-info {
    margin-top: 15px;
    padding: 12px;
    background: rgba(142, 68, 173, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(142, 68, 173, 0.2);
}

.glow-indicator {
    text-align: center;
}

.glow-level {
    font-size: 12px;
    color: #8e44ad;
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
}

.glow-bar {
    width: 100%;
    height: 8px;
    background: rgba(142, 68, 173, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.glow-fill {
    height: 100%;
    background: linear-gradient(90deg, #8e44ad, #bb6bd9);
    width: 0%;
    transition: width 0.8s ease;
    border-radius: 4px;
}

/* Mobile optimization */
@media (max-width: 768px) {
    html, body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    #background-video {
        object-fit: cover;
        object-position: center center;
        width: 100%;
        height: 100vh;
        min-width: auto;
        min-height: auto;
    }

    .video-container {
        background-color: #000;
    }

    .overlay {
        overflow-y: auto;
        align-items: flex-start;
        padding: 20px 0;
    }

    .content-container {
        padding: 20px;
        margin: 10px;
        max-width: 95%;
        max-height: none;
        min-height: auto;
    }

    .title {
        font-size: 1.8em;
        margin-bottom: 10px;
    }

    .subtitle {
        font-size: 0.95em;
        margin-bottom: 20px;
    }

    #message-input {
        height: 100px;
        font-size: 16px;
    }

    .button-container {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-top: 20px;
    }

    .release-button, .save-button, .view-button {
        width: 100%;
        max-width: 280px;
        padding: 14px 20px;
        font-size: 16px;
        margin: 0;
    }

    .dreamcatcher-button {
        padding: 18px 25px;
        font-size: 16px;
    }

    .profile-form {
        margin: 15px 0;
        padding: 20px;
    }

    .profile-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .save-profile-button, .cancel-button {
        width: 100%;
        padding: 14px 20px;
    }

    .floating-symbol {
        font-size: 2.5rem;
        text-shadow: 0 0 20px rgba(255, 255, 255, 1);
    }

    .floating-message-text {
        font-size: 1rem;
        background: rgba(0, 0, 0, 0.3);
        text-shadow: 0 0 20px rgba(255, 255, 255, 1), 0 0 40px rgba(255, 255, 255, 0.6);
    }

    .floating-container {
        transform: scale(1.1);
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .overlay {
        padding: 15px 0;
    }

    .content-container {
        padding: 15px;
        margin: 5px;
        border-radius: 15px;
    }

    .title {
        font-size: 1.6em;
    }

    .subtitle {
        font-size: 0.9em;
        margin-bottom: 15px;
    }

    #message-input {
        height: 90px;
        padding: 12px;
    }

    .button-container {
        gap: 10px;
        margin-top: 15px;
    }

    .release-button, .save-button, .view-button {
        padding: 12px 18px;
        font-size: 15px;
        max-width: 100%;
    }

    .dreamcatcher-button {
        padding: 15px 20px;
        font-size: 15px;
    }

    .modal-content {
        padding: 20px;
        margin: 20px;
    }
}