* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 50px;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.tool-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.tool-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.tool-card h2 {
    color: #333;
    margin-bottom: 15px;
}

.tool-card p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-small {
    display: inline-block;
    background: #f0f0f0;
    color: #333;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #e0e0e0;
}

/* Chatbot Styles */
.chat-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.chat-header, .tool-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
}

.message {
    margin-bottom: 20px;
    padding: 10px 15px;
    border-radius: 10px;
    animation: slideIn 0.3s ease;
}

.message.user {
    background: #e3f2fd;
    margin-left: 20%;
}

.message.assistant {
    background: white;
    margin-right: 20%;
    border: 1px solid #e0e0e0;
}

.message.system {
    background: #f0f0f0;
    text-align: center;
    color: #666;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.message strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.message p {
    line-height: 1.6;
    color: #555;
}

.chat-input {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-input form {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
}

.chat-input button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
}

.chat-actions {
    padding: 15px 20px;
    background: #f9f9f9;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

/* Plagiarism & Humanizer Styles */
.tool-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.analysis-form, .humanizer-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.results {
    padding: 30px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
}

.results h2 {
    margin-bottom: 20px;
    color: #333;
}

.result-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.result-card h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.score-bar {
    background: #f0f0f0;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
}

.score-fill {
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    height: 100%;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: bold;
}

.score-fill.ai {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.score-value {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 10px;
}

.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.original, .humanized {
    background: white;
    padding: 20px;
    border-radius: 10px;
}

.text-box {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}

.humanized-text {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.analysis {
    background: white;
    padding: 20px;
    border-radius: 10px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .message.user, .message.assistant {
        margin: 0 0 20px 0;
    }
    
    .comparison {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
}