* {
    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: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    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, .search-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

textarea {
    resize: vertical;
}

.search-input {
    margin-bottom: 15px;
}

textarea:focus, .search-input: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-message {
    text-align: center;
    padding: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    background: white;
    border-radius: 10px;
    border-left: 5px solid #667eea;
}

.result-message.found {
    border-left-color: #28a745;
    color: #28a745;
}

.result-message.not-found {
    border-left-color: #dc3545;
    color: #dc3545;
}

.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: 300px;
    overflow-y: auto;
}

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

.process-step.recursive-call {
    border-left-color: #ffc107;
    background: #fff9e6;
}

.process-step.base-case {
    border-left-color: #28a745;
    background: #e8f5e9;
}

.process-step.result {
    border-left-color: #667eea;
    background: #e3f2fd;
    font-weight: bold;
}

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