* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 40px;
}

.input-section {
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.product-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.product-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.analyze-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.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;
}

.help-text {
    margin-top: 10px;
    color: #666;
    font-size: 0.9rem;
}

.loading-section {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.error-section {
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.error-section p {
    color: #c33;
    font-size: 1.1rem;
}

.results-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.positive-icon {
    color: #4caf50;
}

.neutral-icon {
    color: #ff9800;
}

.negative-icon {
    color: #f44336;
}

.chart-container {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.chart-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.summary-container {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.summary-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.summary-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    line-height: 1.8;
    font-size: 1.05rem;
    color: #555;
}

/* 상품 정보 섹션 스타일 */
.product-info-section {
    animation: fadeIn 0.5s ease;
    margin-bottom: 40px;
}

.product-info-section h2 {
    margin-bottom: 30px;
    color: #333;
    text-align: center;
}

.product-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-card h3 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
}

.info-card p {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.similar-products-container {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.similar-products-container h3 {
    margin-bottom: 15px;
    color: #333;
}

.similar-products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.similar-product-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.similar-product-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.similar-product-item a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.similar-product-item a:hover {
    text-decoration: underline;
}

.action-section {
    text-align: center;
    padding: 20px;
}

/* 리뷰 표시 섹션 스타일 */
.reviews-display-section {
    animation: fadeIn 0.5s ease;
    margin-top: 30px;
}

.reviews-display-section h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.reviews-container {
    margin-top: 40px;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.reviews-header h2 {
    margin: 0;
    color: #333;
}

.export-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.table-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.reviews-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.reviews-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.reviews-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    border: none;
}

.reviews-table th:first-child {
    width: 60px;
    text-align: center;
}

.reviews-table th:nth-child(2) {
    width: 80px;
    text-align: center;
}

.reviews-table th:nth-child(3) {
    width: 100px;
    text-align: center;
}

.reviews-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.reviews-table tbody tr:hover {
    background-color: #f8f9fa;
}

.reviews-table tbody tr:last-child {
    border-bottom: none;
}

.reviews-table td {
    padding: 15px 10px;
    vertical-align: top;
}

.reviews-table td:first-child {
    text-align: center;
    font-weight: 600;
    color: #667eea;
}

.reviews-table td:nth-child(2) {
    text-align: center;
}

.reviews-table td:nth-child(3) {
    text-align: center;
}

.rating-stars {
    color: #ffc107;
    font-size: 1.1rem;
}

.sentiment-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.sentiment-badge.positive {
    background: #d4edda;
    color: #155724;
}

.sentiment-badge.negative {
    background: #f8d7da;
    color: #721c24;
}

.sentiment-badge.neutral {
    background: #fff3cd;
    color: #856404;
}

.review-text {
    line-height: 1.6;
    color: #555;
    max-width: 500px;
    word-wrap: break-word;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.review-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.review-item.positive {
    border-left-color: #4caf50;
}

.review-item.negative {
    border-left-color: #f44336;
}

.review-item.neutral {
    border-left-color: #ff9800;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.review-rating {
    color: #ffc107;
}

.review-sentiment {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.review-sentiment.positive {
    background: #c8e6c9;
    color: #2e7d32;
}

.review-sentiment.negative {
    background: #ffcdd2;
    color: #c62828;
}

.review-sentiment.neutral {
    background: #ffe0b2;
    color: #e65100;
}

.review-text {
    color: #555;
    line-height: 1.6;
}

footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
    color: #666;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

