/* CSS Variables */
:root {
    --dark-bg: #0f1021;
    --light-blue: #4fd6ff;
    --sakura-pink: #ffb7c5;
    --deep-purple: #6a6ee8;
    --soft-gold: #e6c776;
    --line-green: #06C755;
    --gradient-blue: linear-gradient(135deg, #4fd6ff 0%, #6a6ee8 100%);
    --gradient-sakura: linear-gradient(135deg, #ffb7c5 0%, #ff8ba7 100%);
    --gradient-gold: linear-gradient(135deg, #e6c776 0%, #d4af37 100%);
    --gradient-green: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-purple: linear-gradient(135deg, #8E2DE2 0%, #4A00E0 100%);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--dark-bg);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* 3D Background Container */
#three-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

/* AI Animation Container */
.ai-animation-container {
    width: 100%;
    max-width: 28rem;
    height: 16rem;
    position: relative;
    margin-bottom: 2rem;
    overflow: hidden;
    border-radius: 1rem;
    background: #ffffff0d;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 8px 32px #4fd6ff33;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Data River */
.data-river {
    position: absolute;
    width: 100%;
    height: 60%;
    bottom: 0;
    background: linear-gradient(180deg, #6a6ee81a, #4fd6ff66);
    overflow: hidden;
}

.data-stream {
    position: absolute;
    height: 100%;
    width: 300%;
    left: 0;
    display: flex;
    flex-wrap: wrap;
    animation: flowLeft 25s linear infinite;
}

@keyframes flowLeft {
    0% { transform: translate(0); }
    100% { transform: translate(-33.33%); }
}

/* Stock Bubbles */
.stock-bubble {
    background: #ffffffe6;
    color: #0f1021;
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 8px #0003;
    margin: 0.6rem;
    height: fit-content;
    min-width: 7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(79, 214, 255, 0.3);
    transform-origin: center center;
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-8px) rotate(1deg); }
    50% { transform: translateY(0) rotate(0); }
    75% { transform: translateY(8px) rotate(-1deg); }
}

.stock-bubble:nth-child(odd) {
    animation-delay: 0.5s;
}

.stock-bubble:nth-child(3n) {
    animation-delay: 1.5s;
}

.stock-bubble:nth-child(3n+1) {
    animation-delay: 2.5s;
}

.stock-code {
    font-weight: 700;
    color: #4a00e0;
    margin-bottom: 0.2rem;
}

.stock-name {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
}

/* AI Robot */
.robot {
    position: absolute;
    width: 5rem;
    height: 5rem;
    top: 20%;
    left: 50%;
    transform: translate(-50%);
    animation: hover 3s ease-in-out infinite;
    z-index: 10;
}

@keyframes hover {
    0%, 100% { transform: translate(-50%) translateY(0); }
    50% { transform: translate(-50%) translateY(-10px); }
}

.robot-body {
    position: absolute;
    width: 3rem;
    height: 4rem;
    background: var(--light-blue);
    border-radius: 1rem;
    top: 1rem;
    left: 1rem;
    box-shadow: 0 4px 8px #0000004d;
    overflow: hidden;
}

.robot-lights {
    position: absolute;
    width: 100%;
    height: 0.5rem;
    bottom: 0.5rem;
    display: flex;
    justify-content: space-around;
}

.robot-light {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--soft-gold);
    animation: blink 1s infinite;
}

.robot-light:nth-child(2) {
    animation-delay: 0.3s;
}

.robot-light:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.robot-head {
    position: absolute;
    width: 2.5rem;
    height: 2.5rem;
    background: #60a5fa;
    border-radius: 1.25rem;
    top: 0;
    left: 1.25rem;
    box-shadow: 0 4px 8px #0000004d;
    overflow: hidden;
}

.robot-face {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.robot-eyes {
    display: flex;
    width: 100%;
    justify-content: space-around;
    padding: 0 0.4rem;
}

.robot-eye {
    position: relative;
    width: 0.8rem;
    height: 0.8rem;
    background: #fff;
    border-radius: 50%;
    overflow: hidden;
}

.robot-pupil {
    position: absolute;
    width: 0.4rem;
    height: 0.4rem;
    background: #121026;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: scan 3s infinite;
}

@keyframes scan {
    0%, 100% { transform: translate(-50%, -50%); }
    25% { transform: translate(-30%, -50%); }
    75% { transform: translate(-70%, -50%); }
}

.robot-mouth {
    width: 1.2rem;
    height: 0.3rem;
    background: #e5e7eb;
    margin-top: 0.3rem;
    border-radius: 0.15rem;
    position: relative;
    overflow: hidden;
}

.robot-mouth:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: #3b82f6;
    animation: talk 2s infinite;
    transform: translate(-100%);
}

@keyframes talk {
    0%, 100% { transform: translate(-100%); }
    10%, 30%, 50%, 70%, 90% { transform: translate(0); }
    20%, 40%, 60%, 80% { transform: translate(-100%); }
}

.robot-antenna {
    position: absolute;
    width: 0.3rem;
    height: 0.8rem;
    background: #93c5fd;
    top: -0.8rem;
    left: 1.1rem;
    border-radius: 0.15rem;
}

.robot-antenna:after {
    content: "";
    position: absolute;
    width: 0.5rem;
    height: 0.5rem;
    background: var(--soft-gold);
    border-radius: 50%;
    top: -0.3rem;
    left: -0.1rem;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Magnifying Glass */
.magnifying-glass {
    position: absolute;
    width: 2.5rem;
    height: 2.5rem;
    right: -1rem;
    bottom: 0.5rem;
    animation: search 2s ease-in-out infinite;
    z-index: 5;
}

@keyframes search {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(20deg); }
}

.glass-handle {
    position: absolute;
    width: 0.4rem;
    height: 1.8rem;
    background: #d1d5db;
    border-radius: 0.2rem;
    transform: rotate(-45deg);
    bottom: 0;
    right: 0;
}

.glass-circle {
    position: absolute;
    width: 1.5rem;
    height: 1.5rem;
    border: 0.3rem solid #D1D5DB;
    border-radius: 50%;
    top: 0;
    left: 0;
    background: #fff3;
}

/* Scan Beam */
.scan-beam {
    position: absolute;
    width: 5rem;
    height: 60%;
    bottom: 0;
    left: 50%;
    transform: translate(-50%);
    background: linear-gradient(to bottom, #4fd6ff00, #4fd6ff4d);
    clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%);
    opacity: 0.7;
    animation: scanBeam 4s infinite;
}

@keyframes scanBeam {
    0%, 100% { 
        opacity: 0.3; 
        transform: translate(-50%) scaleX(0.8); 
    }
    50% { 
        opacity: 0.7; 
        transform: translate(-50%) scaleX(1); 
    }
}

/* Data Particles */
.data-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.data-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.7;
    animation: float-up 3s linear infinite;
}

@keyframes float-up {
    0% { 
        transform: translateY(100%) translate(0); 
        opacity: 0; 
    }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    100% { 
        transform: translateY(-100%) translate(var(--x-move)); 
        opacity: 0; 
    }
}

/* Benefits Section */
.benefits-section {
    width: 100%;
    max-width: 28rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #ffffff0d;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 1rem;
    box-shadow: 0 8px 32px #4fd6ff33;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.benefits-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.benefits-text {
    color: #ffffffe6;
    font-size: 0.95rem;
    line-height: 1.7;
    text-align: justify;
}

.highlight-stat {
    display: inline-block;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--light-blue);
    margin: 0 0.15rem;
}

/* Form Card */
.form-card {
    background-color: #fff;
    border-radius: 1.5rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 28rem;
    box-shadow: 0 10px 25px #0003;
}

.form-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #111827;
    display: flex;
    align-items: center;
}

.highlight-text {
    color: var(--deep-purple);
    font-weight: 700;
}

.highlight-badge {
    display: inline-block;
    background: var(--gradient-blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
    transform: rotate(-3deg);
    box-shadow: 0 2px 4px #4fd6ff4d;
}

.form-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.input-container {
    background-color: #f3f4f6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    border: 1px solid #E5E7EB;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-container:focus-within {
    border-color: var(--deep-purple);
    box-shadow: 0 0 0 2px #6a6ee833;
}

.input-field {
    background-color: transparent;
    border: none;
    outline: none;
    flex: 1;
    color: #374151;
    font-family: 'Noto Sans JP', sans-serif;
}

.continue-btn {
    width: 100%;
    background: var(--gradient-sakura);
    color: #111827;
    font-weight: 500;
    padding: 0.75rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px #ffb7c566;
}

.disclaimer-text {
    font-size: 0.7rem;
    text-align: center;
    color: #9ca3af;
    line-height: 1.4;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: #000000b3;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    width: 91.666667%;
    max-width: 28rem;
    position: relative;
    box-shadow: 0 25px 50px #00000040;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.5rem;
}

.close-btn:hover {
    color: #111827;
}

.modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader-circle {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background-color: #ebf5ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.loader-circle:after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: conic-gradient(transparent, transparent, var(--light-blue));
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0); }
    100% { transform: rotate(360deg); }
}

.spinner {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: 0 0 10px #0000001a;
}

.spinner-icon {
    width: 2rem;
    height: 2rem;
    color: var(--light-blue);
    animation: pulse 2s infinite;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.modal-text {
    color: #4b5563;
    text-align: center;
    margin-bottom: 1rem;
}

.stock-info {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px #0000000d;
}

.stock-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--gradient-blue);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    color: #fff;
    font-weight: 700;
}

.stock-details {
    flex: 1;
}

.stock-code-display {
    font-weight: 600;
    color: #111827;
}

.stock-name-display {
    font-size: 0.875rem;
    color: #6b7280;
}

.analysis-progress {
    width: 100%;
    margin-bottom: 1.5rem;
}

.progress-section {
    margin-bottom: 1rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.progress-percentage {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--light-blue);
}

.progress-bar {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 9999px;
    height: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 9999px;
    width: 0%;
    transition: width 0.5s ease-in-out;
}

.progress-fill-market {
    background: var(--gradient-blue);
}

.progress-fill-technical {
    background: var(--gradient-purple);
}

.progress-fill-fundamental {
    background: var(--gradient-green);
}

.progress-fill-sentiment {
    background: var(--gradient-sakura);
}

.status-updates {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    max-height: 8rem;
    overflow-y: auto;
    margin-bottom: 1rem;
    border: 1px solid #E5E7EB;
}

.status-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-icon {
    margin-right: 0.5rem;
    color: var(--light-blue);
    flex-shrink: 0;
}

.status-text {
    flex: 1;
}

.status-time {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 0.5rem;
}

.line-icon {
    width: 2.5rem;
    height: 2.5rem;
    fill: var(--line-green);
}

.benefits-container {
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    padding: 1rem;
    width: 100%;
    margin-bottom: 1.5rem;
}

.benefits-list {
    color: #4b5563;
    list-style: none;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.check-mark {
    color: #10b981;
    margin-right: 0.5rem;
}

.line-btn {
    width: 100%;
    background: var(--line-green);
    color: #fff;
    font-weight: 500;
    padding: 0.75rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.line-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px #06c75540;
}

.line-btn svg {
    margin-right: 0.5rem;
}

.later-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.875rem;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: color 0.2s;
}

.later-btn:hover {
    color: #111827;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .ai-animation-container {
        height: 14rem;
    }
    
    .benefits-section {
        padding: 1rem;
    }
    
    .form-card {
        padding: 1rem;
    }
    
    .modal-content {
        width: 95%;
        padding: 1rem;
    }
}
