/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00bcd4;
    --primary-dark: #0097a7;
    --accent-orange: #ff9800;
    --accent-yellow: #ffc107;
    --text-white: #ffffff;
    --text-gray: #b0bec5;
    --text-highlight: #ff9800;
    --background-gradient: linear-gradient(135deg, #1a237e 0%, #283593 25%, #3949ab  50%, #5c6bc0 75%, #7986cb 100%);
    --card-bg: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.15);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-white);
    background: var(--background-gradient);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Layout */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    text-align: center;
    position: relative;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

/* Logo */
.logo-container {
    margin-bottom: 40px;
}

.logo {
    display: inline-block;
}

.panda-avatar {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
    animation: float 3s ease-in-out infinite;
}

/* Typography */
.main-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(255, 152, 0, 0.3);
}

.subtitle {
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 40px;
    color: var(--text-white);
}

/* Description */
.description {
    margin-bottom: 50px;
    max-width: 500px;
}

.description p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--text-white);
}

.description .details {
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.7;
}

.highlight {
    color: var(--accent-orange);
    font-weight: 700;
}

.viewers-count {
    color: var(--accent-orange);
    font-weight: 600;
    text-decoration: underline;
}

/* Risk Notice */
.risk-notice {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 30px auto;
    max-width: 500px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-white);
    text-align: center;
    backdrop-filter: blur(10px);
}

/* Input Section */
.input-section {
    width: 100%;
    max-width: 400px;
    margin-bottom: 60px;
    position: relative;
}

.stock-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 50px;
    background: var(--input-bg);
    color: var(--text-white);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.stock-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.stock-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(66, 165, 245, 0.5);
    transform: translateY(-1px);
}

.analyze-button {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    font-family: 'Inter', sans-serif;
}

.analyze-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #00acc1 0%, #00838f 100%);
}

.analyze-button:active {
    transform: translateY(0);
}

/* Smart Input Validation */
.stock-input.valid-input {
    border: 2px solid #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.stock-input.invalid-input {
    border: 2px solid #ff5722;
    box-shadow: 0 0 0 2px rgba(255, 87, 34, 0.3);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #1a237e;
}

.suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.suggestion-item:first-child {
    border-radius: 12px 12px 0 0;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: rgba(0, 188, 212, 0.1);
    transform: translateX(3px);
}

.suggestion-symbol {
    font-weight: 700;
    font-size: 1rem;
    color: #1a237e;
    min-width: 60px;
}

.suggestion-name {
    flex: 1;
    font-size: 0.9rem;
    color: #424242;
    margin: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-type {
    font-size: 0.75rem;
    background: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 55px;
    text-align: center;
}

.suggestion-type {
    background: var(--primary-color);
}

/* Different colors for different instrument types - using data attributes for better compatibility */
.suggestion-item[data-type="stock"] .suggestion-type {
    background: #2196f3;
}

.suggestion-item[data-type="crypto"] .suggestion-type {
    background: #ff9800;
}

.suggestion-item[data-type="forex"] .suggestion-type {
    background: #4caf50;
}

.suggestion-item[data-type="index"] .suggestion-type {
    background: #9c27b0;
}

.suggestion-item[data-type="commodity"] .suggestion-type {
    background: #795548;
}

/* Error Message */
.input-error-message {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 87, 34, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: -15px;
    z-index: 999;
    backdrop-filter: blur(10px);
    display: none;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.disclaimer {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 20px;
    font-weight: 500;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: underline;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: rgba(0, 188, 212, 0.8);
}

/* Cookie Notice */
.cookie-notice {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    z-index: 1000;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.cookie-notice span {
    font-size: 0.9rem;
    color: var(--text-white);
    flex: 1;
}

.cookie-accept {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cookie-accept:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.cookie-notice.hidden {
    display: none;
}

/* Analysis Modal */
.analysis-modal .ai-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: pulse-ai 2s ease-in-out infinite;
}

.progress-container {
    margin: 30px 0;
}

.progress-item {
    margin-bottom: 20px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-label {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    text-align: left;
    display: flex;
    align-items: center;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00bcd4, #4dd0e1);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

.progress-percentage {
    color: #00bcd4;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: right;
}

/* Animations */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-10px) rotate(2deg); 
    }
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(66, 165, 245, 0.3);
    }
    50% { 
        box-shadow: 0 0 30px rgba(66, 165, 245, 0.6);
    }
}

@keyframes pulse-ai {
    0%, 100% { 
        transform: scale(1);
    }
    50% { 
        transform: scale(1.1);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .main-title {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1.5rem;
    }
    
    .panda-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
    
    .description p {
        font-size: 0.95rem;
    }
    
    .description .details {
        font-size: 0.9rem;
    }
    
    .stock-input,
    .analyze-button {
        font-size: 1rem;
        padding: 14px 18px;
    }
    
    .autocomplete-dropdown {
        margin-top: 3px;
    }
    
    .suggestion-item {
        padding: 10px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .suggestion-name {
        margin: 0;
        font-size: 0.85rem;
    }
    
    .suggestion-type {
        align-self: flex-end;
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1.3rem;
    }
    
    .panda-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .cookie-notice {
        flex-direction: column;
        gap: 10px;
        left: 10px;
        right: 10px;
    }
    
    .cookie-notice span {
        text-align: center;
    }
    
    .cookie-accept {
        width: 100%;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--background-gradient);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    margin: 20px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-white);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-white);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
    color: var(--text-white);
}

.modal-body h4 {
    color: var(--accent-orange);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 20px 0 10px 0;
    display: flex;
    align-items: center;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--text-gray);
    font-size: 0.95rem;
}

.modal-body ul {
    margin: 10px 0 15px 20px;
    color: var(--text-gray);
}

.modal-body li {
    margin-bottom: 8px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.modal-body strong {
    color: var(--text-white);
    font-weight: 600;
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 20px;
        max-height: 65vh;
    }
    
    .modal-body h4 {
        font-size: 1rem;
    }
    
    .modal-body p,
    .modal-body li {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 5px;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-body {
        padding: 15px;
        max-height: 70vh;
    }
}
