/* Mobile PWA Styles - Matching Desktop Gradient Theme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #050505;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #ffffff;
    position: fixed;
}

/* Logout button (top right) - Icon only */
.logout-button {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 100 !important;
    width: 44px !important;
    height: 44px !important;
    border: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: rgba(255, 255, 255, 0.7) !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease;
    pointer-events: auto;
    touch-action: manipulation;
    padding: 10px !important;
}

.logout-button:hover {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.1);
}

.logout-button:active {
    background: transparent !important;
    transform: scale(0.95);
    color: rgba(255, 255, 255, 1) !important;
}

.logout-button svg {
    width: 24px !important;
    height: 24px !important;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Animated gradient background (same as desktop) */
.fluid-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.fluid-bg::before,
.fluid-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.25;
}

/* Blob 1 - Pink/Magenta */
.fluid-bg::before {
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle at 30% 40%, rgba(255, 0, 128, 0.6) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(121, 40, 202, 0.5) 0%, transparent 45%);
    animation: blobMove1 20s ease-in-out infinite;
}

/* Blob 2 - Blue/Purple */
.fluid-bg::after {
    width: 180%;
    height: 180%;
    top: -40%;
    left: -40%;
    background: radial-gradient(circle at 60% 30%, rgba(58, 123, 213, 0.5) 0%, transparent 45%),
                radial-gradient(circle at 40% 70%, rgba(157, 0, 255, 0.4) 0%, transparent 40%);
    animation: blobMove2 25s ease-in-out infinite;
}

/* Recording state - Green/Cyan blobs */
.fluid-bg.recording::before {
    background: radial-gradient(circle at 30% 40%, rgba(0, 255, 136, 0.5) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(0, 210, 255, 0.4) 0%, transparent 45%);
    opacity: 0.3;
}

.fluid-bg.recording::after {
    background: radial-gradient(circle at 60% 30%, rgba(58, 123, 213, 0.4) 0%, transparent 45%),
                radial-gradient(circle at 40% 70%, rgba(0, 180, 200, 0.35) 0%, transparent 40%);
    opacity: 0.3;
}

@keyframes blobMove1 {
    0%, 100% { transform: translate(0%, 0%) rotate(0deg); }
    25% { transform: translate(5%, 10%) rotate(90deg); }
    50% { transform: translate(10%, 5%) rotate(180deg); }
    75% { transform: translate(5%, -5%) rotate(270deg); }
}

@keyframes blobMove2 {
    0%, 100% { transform: translate(0%, 0%) rotate(0deg); }
    25% { transform: translate(-8%, 5%) rotate(-90deg); }
    50% { transform: translate(-5%, -8%) rotate(-180deg); }
    75% { transform: translate(8%, -3%) rotate(-270deg); }
}

/* Main container - Layout like desktop app */
.container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 0;
}

/* Connection status - Fixed at top center */
.connection-status {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: 12px 30px;
    border-radius: 12px;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Pulsating gradient border - shows during connecting with pink/purple/blue */
.status-border {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(
        90deg,
        rgba(255, 0, 128, 1),
        rgba(121, 40, 202, 1),
        rgba(58, 123, 213, 1),
        rgba(0, 255, 200, 1),
        rgba(255, 0, 128, 1)
    );
    background-size: 300% 100%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: aiBorderFlow 4s linear infinite;
    filter: blur(3px) brightness(1.3) saturate(1.4);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Show pink/purple gradient only when connecting (not connected yet) */
.connection-status:not(.connected) .status-border {
    opacity: 1;
}

.status-border-inner {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(
        90deg,
        rgba(255, 0, 128, 0.8),
        rgba(121, 40, 202, 0.8),
        rgba(58, 123, 213, 0.8),
        rgba(0, 255, 200, 0.8),
        rgba(255, 0, 128, 0.8)
    );
    background-size: 300% 100%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: aiBorderFlow 4s linear infinite;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Show pink/purple gradient only when connecting */
.connection-status:not(.connected) .status-border-inner {
    opacity: 1;
}

/* Green animated gradient when connected */
.connection-status.connected .status-border {
    background: linear-gradient(
        90deg,
        rgba(0, 255, 136, 1),
        rgba(0, 220, 180, 1),
        rgba(0, 200, 255, 1),
        rgba(80, 255, 200, 1),
        rgba(0, 255, 136, 1)
    );
    background-size: 300% 100%;
    animation: aiBorderFlow 4s linear infinite;
    opacity: 1;
}

.connection-status.connected .status-border-inner {
    background: linear-gradient(
        90deg,
        rgba(0, 255, 136, 0.8),
        rgba(0, 220, 180, 0.8),
        rgba(0, 200, 255, 0.8),
        rgba(80, 255, 200, 0.8),
        rgba(0, 255, 136, 0.8)
    );
    background-size: 300% 100%;
    animation: aiBorderFlow 4s linear infinite;
    opacity: 1;
}

@keyframes aiBorderFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.status-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-icon {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s;
}

.connection-status.connected .status-icon {
    color: rgba(0, 255, 136, 1);
}

.connection-status.error .status-icon {
    color: rgba(255, 80, 80, 1);
}

.status-text {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9);
}

/* Wave visualization - Centered between status and button */
.wave-container {
    position: fixed;
    top: calc(50% - 80px);
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    opacity: 1;
    pointer-events: none;
    width: 100vw;
    max-width: 2400px;
}

#waveCanvas {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: auto;
    filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.3));
}

/* Record button - Moved up with glowing gradient border */
.record-button {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.record-button:active {
    transform: translateX(-50%) scale(0.95);
}

/* Glowing gradient border for record button - matches connection status animation */
.record-button-gradient {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(
        90deg,
        rgba(255, 0, 128, 1),
        rgba(121, 40, 202, 1),
        rgba(58, 123, 213, 1),
        rgba(0, 255, 200, 1),
        rgba(255, 0, 128, 1)
    );
    background-size: 300% 100%;
    animation: aiBorderFlow 4s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    filter: blur(2px) brightness(1.3) saturate(1.4);
    box-shadow: 0 0 20px rgba(255, 0, 180, 0.5),
                0 0 40px rgba(180, 60, 255, 0.3);
}

.record-button.recording .record-button-gradient {
    background: linear-gradient(
        90deg,
        rgba(0, 255, 136, 1),
        rgba(0, 220, 180, 1),
        rgba(0, 200, 255, 1),
        rgba(80, 255, 200, 1),
        rgba(0, 255, 136, 1)
    );
    background-size: 300% 100%;
    animation: aiBorderFlow 4s linear infinite;
    box-shadow: 0 0 25px rgba(0, 255, 180, 0.6),
                0 0 50px rgba(0, 220, 255, 0.4);
}

.record-button-content {
    position: absolute;
    inset: 3px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 50%;
    background: #050505;
    overflow: hidden;
}

/* Animated gradient background inside button (brighter colors) */
.record-button-content::before,
.record-button-content::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(25px);
    opacity: 0.6;
}

/* Blob 1 - Darker Pink/Magenta */
.record-button-content::before {
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle at 30% 40%, rgba(255, 0, 180, 0.25) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(180, 60, 255, 0.20) 0%, transparent 45%);
    animation: blobMove1 20s ease-in-out infinite;
}

/* Blob 2 - Darker Blue/Purple */
.record-button-content::after {
    width: 180%;
    height: 180%;
    top: -40%;
    left: -40%;
    background: radial-gradient(circle at 60% 30%, rgba(80, 150, 255, 0.20) 0%, transparent 45%),
                radial-gradient(circle at 40% 70%, rgba(200, 0, 255, 0.18) 0%, transparent 40%);
    animation: blobMove2 25s ease-in-out infinite;
}

/* Recording state - Darker Green/Cyan blobs */
.record-button.recording .record-button-content::before {
    background: radial-gradient(circle at 30% 40%, rgba(0, 255, 180, 0.35) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(0, 220, 255, 0.30) 0%, transparent 45%);
    opacity: 0.5;
}

.record-button.recording .record-button-content::after {
    background: radial-gradient(circle at 60% 30%, rgba(80, 200, 255, 0.30) 0%, transparent 45%),
                radial-gradient(circle at 40% 70%, rgba(0, 255, 200, 0.25) 0%, transparent 40%);
    opacity: 0.5;
}

.record-button-mic-icon {
    position: absolute;
    z-index: 1;
    width: 100px;
    height: 100px;
    top: 54%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
    filter: drop-shadow(0 0 20px rgba(255, 0, 180, 0.5)) drop-shadow(0 0 40px rgba(180, 60, 255, 0.3));
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    transition: filter 0.3s, opacity 0.3s;
}

.record-button.recording .record-button-mic-icon {
    opacity: 1;
    filter: drop-shadow(0 0 25px rgba(0, 255, 180, 0.6)) drop-shadow(0 0 50px rgba(0, 220, 255, 0.4));
}

.record-button-text {
    position: relative;
    z-index: 2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    transition: color 0.3s;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    animation: textPulse 2s ease-in-out infinite;
}

.record-button.recording .record-button-text {
    color: rgba(0, 255, 200, 1);
    animation: none;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Mode toggle switch - Below record button */
.mode-toggle {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 6px;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 6px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    touch-action: manipulation;
}

.mode-option {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.3px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mode-option.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(168, 85, 247, 0.3));
    color: rgba(255, 255, 255, 1);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4),
                0 0 40px rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.5);
    transition: all 0.3s ease;
}

/* When recording, switch to green color scheme */
.mode-toggle.recording .mode-option.active {
    background: linear-gradient(135deg, rgba(0, 255, 140, 0.3), rgba(0, 210, 255, 0.3));
    box-shadow: 0 0 20px rgba(0, 255, 180, 0.4),
                0 0 40px rgba(0, 220, 255, 0.2);
    border: 1px solid rgba(0, 255, 180, 0.5);
}

.mode-option:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

/* Diagnostics - Hidden for cleaner UI */
.diagnostics {
    display: none;
}

.diagnostic-item {
    font-size: 11px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    gap: 8px;
}

.diagnostic-label {
    opacity: 0.7;
}

.diagnostic-value {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
}

/* Error message */
.error-message {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    padding: 15px;
    border-radius: 8px;
    background: rgba(255, 80, 80, 0.9);
    backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 12px;
    font-weight: 400;
    text-align: center;
    z-index: 10000;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Login Screen */
.login-container {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    border-radius: 20px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 80px rgba(255, 0, 180, 0.15);
    animation: fadeInScale 0.4s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(135deg, rgba(255, 0, 180, 1), rgba(180, 60, 255, 1));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255, 0, 180, 0.4));
}

.logo-text {
    font-size: 32px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
}

.login-description {
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 30px;
}

.google-login-button {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #333333;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.google-login-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
}

.google-login-button:active {
    transform: translateY(0);
}

.google-icon {
    width: 24px;
    height: 24px;
}

.login-footer {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 20px;
    line-height: 1.5;
}

/* Disconnect button */
.disconnect-button {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border: 2px solid rgba(255, 80, 80, 0.4);
    border-radius: 8px;
    background: rgba(255, 80, 80, 0.1);
    backdrop-filter: blur(10px);
    color: rgba(255, 100, 100, 1);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}

.disconnect-button:hover {
    background: rgba(255, 80, 80, 0.2);
    border-color: rgba(255, 80, 80, 0.6);
}

.disconnect-button:active {
    transform: translateX(-50%) scale(0.95);
}
