@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-secondary: #e8eaed;
    --surface-color: rgba(32, 33, 36, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-color: #8ab4f8;
    --gemini-gradient: linear-gradient(90deg, #8ab4f8, #c58af9, #f28b82, #fdd663);
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: #000000;
    /* Fallback */
    color: var(--text-primary);
    overflow: hidden;
}

/* 
   Gemini-style Breathing Background Container
   This element should be placed at the top of the App component.
*/

.gemini-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Behind everything */
    background-color: #000000;
    overflow: hidden;
}

/* Layer 1: The main colorful wave (Blue, Purple, Pink) */

.gemini-background::before {
    content: '';
    position: absolute;
    bottom: -30vh;
    left: -50%;
    right: -50%;
    height: 80vh;
    background: radial-gradient(50% 50% at 50% 100%,
            rgba(66, 133, 244, 0.6) 0%,
            /* Google Blue */
            rgba(168, 85, 247, 0.4) 25%,
            /* Purple */
            rgba(236, 72, 153, 0.3) 50%,
            /* Pink */
            transparent 80%);
    filter: blur(80px);
    /* Increased blur for smoother look */
    animation: breathe-wave 8s ease-in-out infinite alternate;
    opacity: 0.9;
}

/* Layer 2: A brighter, focused blue core for depth */

.gemini-background::after {
    content: '';
    position: absolute;
    bottom: -20vh;
    left: 0;
    width: 100%;
    height: 60vh;
    background: radial-gradient(ellipse at 50% 100%,
            rgba(56, 189, 248, 0.5) 0%,
            /* Cyan/Sky Blue */
            rgba(59, 130, 246, 0.3) 40%,
            /* Blue */
            transparent 70%);
    filter: blur(50px);
    animation: pulse-core 5s ease-in-out infinite alternate;
    mix-blend-mode: screen;
}

@keyframes breathe-wave {
    0% {
        transform: scale(1) translateY(0);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.1) translateY(-20px);
        opacity: 0.9;
    }

    100% {
        transform: scale(1.05) translateY(10px);
        opacity: 0.8;
    }
}

@keyframes pulse-core {
    0% {
        opacity: 0.5;
        transform: scaleX(0.95) scaleY(0.95);
    }

    100% {
        opacity: 0.9;
        transform: scaleX(1.05) scaleY(1.05);
    }
}

#root {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* --- Animations --- */

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.5s ease-out forwards;
}

.animate-fade-in-up {
    animation: fade-in-up 0.5s ease-out forwards;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* --- UI Elements --- */

button {
    transition: all 0.3s ease;
}

/* Glassmorphism Utilities */

.glass-panel {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
}

/* Gradient Text */

.gemini-gradient-text {
    background: var(--gemini-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Scrollbar */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

/* Report View Styling */

.report-view h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.report-view h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
}

.report-view p,
.report-view li {
    margin-bottom: 0.25rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.report-view strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Live Session UI */

.live-controls-container {
    background: rgba(32, 33, 36, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem;
}

.control-button {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.control-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.control-button-danger {
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.control-button-danger:hover {
    background-color: #dc2626;
}

/* Scanning Animation */

.scanning-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
}

.scanning-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(138, 180, 248, 0.1) 50%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #8ab4f8;
    box-shadow: 0 0 8px #8ab4f8, 0 0 15px #8ab4f8;
    animation: scan 2s linear infinite;
    z-index: 20;
}

@keyframes scan {
    0% {
        top: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Typing Indicator */

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* ===== MOBILE-FIRST RESPONSIVE TYPOGRAPHY ===== */

:root {
    --font-size-base: 14px;
    --font-size-large: 16px;
    --tap-target-min: 44px;
}

@media (min-width: 768px) {
    :root {
        --font-size-base: 16px;
        --font-size-large: 18px;
    }
}

body {
    font-size: var(--font-size-base);
}

/* Ensure tap targets are large enough on mobile */

button,
a,
input,
select,
textarea,
.tap-target {
    min-height: var(--tap-target-min);
    min-width: var(--tap-target-min);
}

/* Mobile typography */

@media (max-width: 768px) {
    h1 {
        font-size: 24px;
        line-height: 1.2;
        margin-bottom: 16px;
    }

    h2 {
        font-size: 20px;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    h3 {
        font-size: 18px;
        line-height: 1.4;
        margin-bottom: 10px;
    }

    p,
    li {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 8px;
    }

    /* Larger buttons on mobile */
    button {
        font-size: 16px;
        padding: 14px 24px;
    }
}

/* ===== BUTTON HIERARCHY ===== */

.btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    font-weight: 600;
    font-size: 16px;
    padding: 14px 32px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.btn-secondary {
    background: #F3F4F6;
    color: #6B7280;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 24px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-secondary:hover:not(:disabled) {
    background: #E5E7EB;
    border-color: #D1D5DB;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Action group - always highlight primary */

.action-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.action-group .btn-primary {
    order: 1;
    /* Always first */
}

.action-group .btn-secondary {
    order: 2;
    /* Always second */
}

/* Mobile button adjustments */

@media (max-width: 768px) {
    .btn-primary {
        width: 100%;
        padding: 16px 32px;
    }

    .btn-secondary {
        width: 100%;
        padding: 12px 24px;
    }

    .action-group {
        flex-direction: column;
        width: 100%;
    }
}