/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--secondary-color, #00e0ff);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.logo-icon:after {
    content: "";
    position: absolute;
    width: 150%;
    height: 150%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    animation: shimmer 4s infinite;
}

.logo-icon {
    font-size: 18px;
    font-weight: bold;
    color: white;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    20%,
    100% {
        transform: translateX(100%);
    }
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav a:hover {
    color: #e0e6ff;
    transform: translateY(-2px);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #e0e6ff;
    transition: width 0.3s ease;
}

.nav a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 3rem 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #8e44ad 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    position: relative;
    overflow: hidden;
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
}

/* 添加动态渐变效果 */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 为不支持动画的浏览器提供静态渐变 */
@supports not (background-size: 300% 300%) {
    .hero-title {
        animation: none;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    @media (max-width: 768px) {
        .hero-title {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
    }
    
    @media (max-width: 480px) {
        .hero-title {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
    }
    
    @media (max-width: 414px) {
        .hero-title {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
    }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
}

.hero-visual {
    margin: 3rem 0;
    position: relative;
}

.visual-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Stock Input Section */
.stock-input-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    text-align: left;
}

.input-container {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

#stock-code {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

#stock-code:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.analyze-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.analyze-btn:active {
    transform: translateY(0);
}

.analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.stock-suggestions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stock-suggestions span {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

.suggestion-btn {
    padding: 0.5rem 1rem;
    background: #f1f3f4;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.suggestion-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Features Section */
.features {
    padding: 3rem 0;
    background: white;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #667eea;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.ai-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
}

.modal-title h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

.modal-title p {
    color: #666;
    font-size: 0.9rem;
}

.analysis-result {
    margin-top: 1rem;
}

.stock-info {
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.stock-info h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.analysis-score {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.score-label {
    font-weight: 600;
    color: #333;
    min-width: 100px;
}

.score-bar {
    flex: 1;
    height: 12px;
    background: #e1e5e9;
    border-radius: 6px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 2s ease;
}

.score-value {
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
}

.analysis-points {
    margin: 0.3rem 0;
}

.point {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 3px solid #667eea;
}

.point-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.point-icon.positive {
    background: #d4edda;
}

.point-icon.warning {
    background: #fff3cd;
}

.point-icon.info {
    background: #d1ecf1;
}

.point-content h4 {
    margin-bottom: 0.3rem;
    color: #333;
}

.point-content p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.band-cta {
    text-align: center;
    padding: 1.2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-top: 1rem;
}

.band-cta p {
    margin-bottom: 1rem;
    color: #666;
}

.band-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 4rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    min-width: 280px;
}

.band-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* Ads Container */
.ads-container {
    text-align: center;
    margin: 0;
    padding: 0;
    display: none;
}

.google-ads {
    margin: 0 auto;
}

.ads-placeholder {
    background: #f0f0f0;
    padding: 1rem;
    border-radius: 12px;
    color: #666;
    font-style: italic;
    border: 2px dashed #ccc;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    padding: 1.5rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #667eea;
}

.footer-section p {
    color: #ccc;
    margin-bottom: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #555;
    color: #999;
}

/* H5 Mobile Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.3;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #8e44ad 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        background-size: 300% 300%;
        animation: gradientShift 3s ease infinite;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .visual-img {
        width: 120px;
        height: 120px;
    }
    
    .input-container {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    #stock-code {
        padding: 0.8rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .analyze-btn {
        padding: 0.8rem 1.5rem;
        font-size: 16px;
        min-height: 48px; /* Better touch target */
    }
    
    .suggestion-btn {
        padding: 0.4rem 0.8rem;
        font-size: 14px;
        min-height: 36px;
    }
    
    .stock-suggestions {
        justify-content: center;
        gap: 0.3rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .nav {
        display: none;
    }
    
    .header .container {
        justify-content: center;
        padding: 0 15px;
    }
    
    .header {
        padding: 0.8rem 0;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .analysis-score {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .score-bar {
        width: 100%;
    }
    
    .stock-input-section {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .band-btn {
        padding: 0.8rem 1.5rem;
        font-size: 16px;
        min-height: 48px;
    }
    
    .point {
        padding: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 1.5rem 0;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 1.5rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #8e44ad 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        background-size: 300% 300%;
        animation: gradientShift 3s ease infinite;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .visual-img {
        width: 100px;
        height: 100px;
    }
    
    .stock-input-section {
        padding: 1rem;
        margin-top: 1rem;
        border-radius: 15px;
    }
    
    .input-group label {
        font-size: 0.9rem;
    }
    
    #stock-code {
        padding: 0.7rem;
        font-size: 16px;
    }
    
    .analyze-btn {
        padding: 0.7rem 1.2rem;
        font-size: 15px;
    }
    
    .suggestion-btn {
        padding: 0.3rem 0.6rem;
        font-size: 12px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .features h2 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    .feature-card {
        padding: 1rem;
        border-radius: 15px;
    }
    
    .feature-icon {
        font-size: 2rem;
    }
    
    .feature-card h3 {
        font-size: 1.2rem;
    }
    
    .feature-card p {
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 2% auto;
        padding: 0.8rem;
        border-radius: 15px;
        max-height: 88vh;
        overflow-y: auto;
    }
    
    .modal-header {
        flex-direction: column;
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .ai-avatar {
        width: 50px;
        height: 50px;
    }
    
    .modal-title h2 {
        font-size: 1.3rem;
    }
    
    .stock-info h3 {
        font-size: 1rem;
        margin-bottom: 0.6rem;
    }
    
    .band-btn {
        padding: 0.7rem 1.2rem;
        font-size: 14px;
        width: 100%;
        max-width: 250px;
    }
    
    .band-cta {
        padding: 1.5rem 1rem;
    }
    
    .band-cta p {
        font-size: 0.9rem;
    }
    
    
    
    .point {
        padding: 0.6rem;
        margin-bottom: 0.6rem;
    }
    
    .point-icon {
        font-size: 1.2rem;
        width: 35px;
        height: 35px;
    }
    
    .point-content h4 {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }
    
    .point-content p {
        font-size: 0.8rem;
    }
    
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-section h4 {
        font-size: 1rem;
    }
    
    .footer-section p {
        font-size: 0.9rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* H5 Mobile Specific Optimizations */
@media (max-width: 414px) {
    .hero-title {
        font-size: 1.3rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #8e44ad 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        background-size: 300% 300%;
        animation: gradientShift 3s ease infinite;
    }
    
    .visual-img {
        width: 80px;
        height: 80px;
    }
    
    .stock-input-section {
        padding: 0.8rem;
    }
    
    .suggestion-btn {
        font-size: 11px;
        padding: 0.25rem 0.5rem;
    }
    
    .analyze-btn, .band-btn {
        font-size: 14px;
        padding: 0.6rem 1rem;
        min-width: 240px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .analyze-btn,
    .suggestion-btn,
    .band-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav a {
        padding: 10px;
    }
}

/* Landscape Mobile Optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 1rem 0;
        min-height: auto;
    }
    
    .hero-visual {
        margin: 1rem 0;
    }
    
    .visual-img {
        width: 60px;
        height: 60px;
    }
    
    .modal-content {
        margin: 2% auto;
        max-height: 96vh;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .visual-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Safe Area Support for Notched Devices */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}

/* Disclaimer Section */
.disclaimer {
    padding: 1rem 0;
    background: white;
}

.disclaimer-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #333;
    font-weight: 600;
}

.disclaimer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    line-height: 1.6;
}

.disclaimer-content p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.disclaimer-content p:last-child {
    margin-bottom: 0;
}

/* Mobile Responsive for Disclaimer */
@media (max-width: 768px) {
    .disclaimer {
        padding: 1.5rem 0;
    }
    
    .disclaimer-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .disclaimer-content {
        padding: 0 1rem;
    }
    
    .disclaimer-content p {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }
}

@media (max-width: 480px) {
    .disclaimer {
        padding: 1rem 0;
    }
    
    .disclaimer-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .disclaimer-content p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 0.6rem;
    }
}
