* {
    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;
}

.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;
    animation: slideIn 0.5s ease-out;
}

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

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

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

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

main {
    padding: 30px;
}

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

label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1rem;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

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

.result-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.result-card, .info-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.result-card h3, .info-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.result-content {
    text-align: center;
    padding: 20px;
}

.word-display {
    margin-bottom: 15px;
}

.label {
    font-weight: 600;
    color: #666;
    margin-right: 10px;
}

.longest-word {
    font-size: 1.5rem;
    font-weight: bold;
    color: #764ba2;
    word-break: break-all;
}

.length {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
}

.algorithm-steps ol {
    margin-left: 20px;
    margin-top: 10px;
}

.algorithm-steps li {
    margin: 10px 0;
    color: #555;
}

code {
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.process-info {
    margin-top: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    font-size: 0.9rem;
    max-height: 200px;
    overflow-y: auto;
}

.process-step {
    padding: 5px;
    margin: 5px 0;
    border-left: 3px solid #667eea;
    padding-left: 10px;
    font-family: monospace;
    font-size: 0.85rem;
}

.example-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
}

.example-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.example-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-example {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-example:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

footer {
    background: #f8f9fa;
    text-align: center;
    padding: 20px;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
    .result-section {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    main {
        padding: 20px;
    }
}