* {
    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: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    font-weight: 600;
}

.search-section {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

#searchInput {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-section {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.form-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-buttons {
    display: flex;
    gap: 10px;
}

button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#submitBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
}

#submitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.cancel-btn {
    background: #6c757d;
    color: white;
    flex: 1;
}

.cancel-btn:hover {
    background: #5a6268;
}

.contacts-section {
    padding: 30px;
}

.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.contacts-header h2 {
    color: #333;
    font-size: 1.5em;
}

.clear-btn {
    background: #dc3545;
    color: white;
    padding: 10px 20px;
}

.clear-btn:hover {
    background: #c82333;
}

.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.no-contacts {
    text-align: center;
    color: #6c757d;
    padding: 40px;
    font-size: 1.1em;
}

.contact-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.contact-name {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
}

.contact-actions {
    display: flex;
    gap: 10px;
}

.edit-btn, .delete-btn {
    padding: 8px 15px;
    font-size: 14px;
}

.edit-btn {
    background: #28a745;
    color: white;
}

.edit-btn:hover {
    background: #218838;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
}

.contact-detail span {
    font-weight: 500;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .contacts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .contact-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .edit-btn, .delete-btn {
        width: 100%;
    }
}