* {
    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;
    color: #333;
}

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

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

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

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

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

.url-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

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

.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.input-group input,
.keyword-inputs textarea {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

.keyword-inputs {
    margin-bottom: 25px;
}

.keyword-inputs label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.analyze-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    margin: 0 auto;
}

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

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

.manual-input-toggle {
    text-align: center;
    margin-bottom: 20px;
}

.manual-help {
    margin-top: 8px;
    color: #6c757d;
}

.manual-help small {
    font-size: 12px;
}

.help-text {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

.toggle-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-btn:hover {
    background: #5a6268;
}

.manual-inputs {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.manual-group {
    margin-bottom: 20px;
}

.manual-group:last-child {
    margin-bottom: 0;
}

.manual-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.manual-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    transition: border-color 0.3s ease;
}

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

.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

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

.status-message {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

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

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

.comparison-chart {
    margin-bottom: 40px;
    text-align: center;
}

.comparison-chart h2 {
    margin-bottom: 20px;
    color: #555;
}

.detailed-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.site-results h3 {
    margin-bottom: 20px;
    color: #555;
    text-align: center;
}

.keyword-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.keyword-name {
    font-weight: 600;
    color: #333;
}

.keyword-count {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.site-url, .total-words {
    padding: 10px 15px;
    background: #f1f3f4;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #28a745;
}

.site-url a {
    color: #667eea;
    text-decoration: none;
}

.site-url a:hover {
    text-decoration: underline;
}

.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
}

.error i {
    font-size: 2rem;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .url-inputs {
        grid-template-columns: 1fr;
    }
    
    .detailed-results {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 15px;
    }
}
