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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

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

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Input Section */
.input-section textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.input-section textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: #f0f0f0;
    color: #666;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.loading {
    text-align: center;
    margin-top: 15px;
    color: #667eea;
    font-weight: 600;
}

/* Result Section */
.result-section {
    animation: fadeIn 0.5s;
}

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

.result-content {
    text-align: center;
}

.sentiment-badge {
    display: inline-block;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.sentiment-positive {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.sentiment-negative {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.sentiment-neutral {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
    color: white;
}

.analyzed-text {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
}

.confidence-score {
    color: #999;
    font-size: 0.9em;
}

/* History Section */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    padding: 15px;
    border-left: 4px solid #667eea;
    background: #f8f9fa;
    margin-bottom: 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-sentiment {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.history-timestamp {
    color: #999;
    font-size: 0.85em;
}

.history-text {
    color: #555;
    line-height: 1.5;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* Popup */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.popup-close:hover {
    color: #333;
}

#popupMessage {
    font-size: 1.1em;
    color: #666;
    margin-top: 10px;
}

footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    opacity: 0.9;
}

/* Scrollbar styling */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .card {
        padding: 20px;
    }
    
    .history-header {
        flex-direction: column;
        gap: 10px;
    }
}
